pub async fn connect(settings: Settings) -> Result<Self> {
        // Create the underlying http client, will be reused for every call
        let http_client = Client::new();

        trace!("Initial connect to '{}'", settings.token_url);
        // Fetch the bearer token for the first time
        let credentials = Arc::new(RwLock::new(Self::get_bearer_token(&settings).await?));
        trace!(
            "Successfully connected: Got bearer token from {}",
            settings.token_url
        );

        Ok(AuthorizedClient {
            credentials,
            http_client,
            settings,
        })
    }
/// Create a new `AuthorizedClient`
///
/// This function immediately tries to get a bearer token from the auth server.
/// When this fails your `settings` are probably incorrect
Create a new `AuthorizedClient`
This function immediately tries to get a bearer token from the auth server.
When this fails your `settings` are probably incorrect
Create a new ` AuthorizedClient ` This function immediately tries to get a bearer token from the auth server . When this fails your ` settings ` are probably incorrect
pub async fn connect(settings: Settings) -> Result<Self> {
        // Create the underlying http client, will be reused for every call
        let http_client = Client::new();
        trace!("Initial connect to '{}'", settings.token_url);
        // Fetch the bearer token for the first time
        let credentials = Arc::new(RwLock::new(Self::get_bearer_token(&settings).await?));
        trace!(
            "Successfully connected: Got bearer token from {}",
            settings.token_url
        );
        Ok(AuthorizedClient {
            credentials,
            http_client,
            settings,
        })
    }
pub async fn connect ( settings : Settings ) -> Result < Self > { // Create the underlying http client, will be reused for every call let http_client = Client :: new ( ) ; trace ! ( " " settings token_url ) ; // Fetch the bearer token for the first time let credentials = Arc :: new ( RwLock :: new ( Self :: get_bearer_token ( & settings ) . await ? ) ) ; trace ! ( " " settings token_url ) ; Ok ( AuthorizedClient { credentials , http_client , settings , } ) }
Create a new `AuthorizedClient`
This function immediately tries to get a bearer token from the auth server.
Create a new ` AuthorizedClient ` This function immediately tries to get a bearer token from the auth server .
settings
Settings
settings
Settings