docs(ClientConfig): Add example for customn reqwest::ClientBuilder

This commit is contained in:
Benjamin Kampmann
2022-02-17 11:43:20 +01:00
parent 81e90c5699
commit bbc92d912f

View File

@@ -40,6 +40,27 @@ use crate::{config::RequestConfig, HttpSend, Result};
/// .disable_ssl_verification();
/// # matrix_sdk::Result::<()>::Ok(())
/// ```
///
/// # Example for using a custom client
/// Note: setting a custom client will ignore `user_agent`, `proxy`, and
/// `disable_ssl_verification` - you'd need to set these yourself if you
/// want them.
///
/// ```
/// use matrix_sdk::config::ClientConfig;
/// use reqwest::ClientBuilder;
/// use std::sync::Arc;
///
/// // setting up a custom builder
/// let builder = ClientBuilder::new()
/// .https_only(true)
/// .no_proxy()
/// .user_agent("MyApp/v3.0");
///
/// let client_config = ClientConfig::new()
/// .client(Arc::new(builder.build()?));
/// # matrix_sdk::Result::<()>::Ok(())
/// ```
#[derive(Default)]
pub struct ClientConfig {
#[cfg(not(target_arch = "wasm32"))]