mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-06 06:53:32 -04:00
docs(ClientConfig): Add example for customn reqwest::ClientBuilder
This commit is contained in:
@@ -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"))]
|
||||
|
||||
Reference in New Issue
Block a user