pub fn new(url: &str, trace: bool) -> anyhow::Result<Self> {
        let cert_file = &mut BufReader::new(
            &std::include_bytes!("../certs/rsa/ca.cert")[..],
        );

        let mut config = rustls::ClientConfig::new();
        config
            .root_store
            .add_pem_file(cert_file)
            .map_err(|_| anyhow::anyhow!("Add pem file to the root store!"))?;
        let connector = actix_web::client::Connector::new()
            .rustls(std::sync::Arc::new(config));
        let rest_client =
            Client::builder().connector(connector.finish()).finish();

        Ok(Self {
            client: rest_client,
            url: url.to_string(),
            trace,
        })
    }
/// creates a new client which uses the specified `url`
creates a new client which uses the specified `url`
creates a new client which uses the specified ` url `
pub fn new(url: &str, trace: bool) -> anyhow::Result<Self> {
        let cert_file = &mut BufReader::new(
            &std::include_bytes!("../certs/rsa/ca.cert")[..],
        );
        let mut config = rustls::ClientConfig::new();
        config
            .root_store
            .add_pem_file(cert_file)
            .map_err(|_| anyhow::anyhow!("Add pem file to the root store!"))?;
        let connector = actix_web::client::Connector::new()
            .rustls(std::sync::Arc::new(config));
        let rest_client =
            Client::builder().connector(connector.finish()).finish();
        Ok(Self {
            client: rest_client,
            url: url.to_string(),
            trace,
        })
    }
pub fn new ( url : & str , trace : bool ) -> anyhow :: Result < Self > { let cert_file = & mut BufReader :: new ( & std :: include_bytes ! ( " " ) [ .. ] , ) ; let mut config = rustls :: ClientConfig :: new ( ) ; config . root_store . add_pem_file ( cert_file ) . map_err ( | _ | anyhow :: anyhow ! ( " " ) ) ? ; let connector = actix_web :: client :: Connector :: new ( ) . rustls ( std :: sync :: Arc :: new ( config ) ) ; let rest_client = Client :: builder ( ) . connector ( connector . finish ( ) ) . finish ( ) ; Ok ( Self { client : rest_client , url : url . to_string ( ) , trace , } ) }
creates a new client which uses the specified `url`
creates a new client which uses the specified ` url `
url
&str
trace
bool