pub fn new_with_config(
        homeserver_url: impl TryInto<Url>,
        config: ClientConfig,
    ) -> Result<Self> {
        let homeserver = if let Ok(u) = homeserver_url.try_into() {
            Arc::new(u)
        } else {
            panic!("Error parsing homeserver url")
        };

        let client = if let Some(client) = config.client {
            client
        } else {
            Arc::new(client_with_config(&config)?)
        };

        let base_client = BaseClient::new_with_config(config.base_config)?;
        let session = base_client.session().clone();

        let http_client = HttpClient {
            homeserver: homeserver.clone(),
            inner: client,
            session,
        };

        Ok(Self {
            homeserver,
            http_client,
            base_client,
            #[cfg(feature = "encryption")]
            group_session_locks: DashMap::new(),
            #[cfg(feature = "encryption")]
            key_claim_lock: Arc::new(Mutex::new(())),
        })
    }
/// Create a new client with the given configuration.
///
/// # Arguments
///
/// * `homeserver_url` - The homeserver that the client should connect to.
///
/// * `config` - Configuration for the client.
Create a new client with the given configuration.
Create a new client with the given configuration .
pub fn new_with_config(
        homeserver_url: impl TryInto<Url>,
        config: ClientConfig,
    ) -> Result<Self> {
        let homeserver = if let Ok(u) = homeserver_url.try_into() {
            Arc::new(u)
        } else {
            panic!("Error parsing homeserver url")
        };
        let client = if let Some(client) = config.client {
            client
        } else {
            Arc::new(client_with_config(&config)?)
        };
        let base_client = BaseClient::new_with_config(config.base_config)?;
        let session = base_client.session().clone();
        let http_client = HttpClient {
            homeserver: homeserver.clone(),
            inner: client,
            session,
        };
        Ok(Self {
            homeserver,
            http_client,
            base_client,
            #[cfg(feature = "encryption")]
            group_session_locks: DashMap::new(),
            #[cfg(feature = "encryption")]
            key_claim_lock: Arc::new(Mutex::new(())),
        })
    }
pub fn new_with_config ( homeserver_url : impl TryInto < Url > , config : ClientConfig , ) -> Result < Self > { let homeserver = if let Ok ( u ) = homeserver_url . try_into ( ) { Arc :: new ( u ) } else { panic ! ( " " ) } ; let client = if let Some ( client ) = config . client { client } else { Arc :: new ( client_with_config ( & config ) ? ) } ; let base_client = BaseClient :: new_with_config ( config . base_config ) ? ; let session = base_client . session ( ) . clone ( ) ; let http_client = HttpClient { homeserver : homeserver . clone ( ) , inner : client , session , } ; Ok ( Self { homeserver , http_client , base_client , # [ cfg ( feature " " ) ] group_session_locks : DashMap :: new ( ) , # [ cfg ( feature " " ) ] key_claim_lock : Arc :: new ( Mutex :: new ( ( ) ) ) , } ) }
Create a new client with the given configuration.
Create a new client with the given configuration .
homeserver_url
impl TryInto<Url>
config
ClientConfig
homeserver_url
impl TryInto<Url>
config
ClientConfig