pub fn new(scheme: &str, registry_url: &str, creds: Credentials) -> Result<Client> {
        let registry_url = scheme.to_string() + "://" + registry_url;

        let registry_base = registry_url
            .parse::<Url>()
            .context(ErrorKind::ClientRegistryUrlMalformed)?;

        if !registry_base.has_host() {
            return Err(ErrorKind::ClientRegistryUrlMissingAuthority.into());
        }
        if registry_base.query().is_some() {
            return Err(ErrorKind::ClientRegistryUrlIncludesQuery.into());
        }

        Ok(Client {
            client: AuthClient::new(ReqwestClient::new(), creds),
            registry_base,
            supports_range_header: Mutex::new(None),
        })
    }
/// Construct a new Client to communicate with container registries.
/// The `registry_url` must have an authority component (i.e: domain),
/// and can optionally include a base path as well (for container registries
/// that are not at "/"). Returns an error if the registry Url is malformed.
Construct a new Client to communicate with container registries.
The `registry_url` must have an authority component ,
and can optionally include a base path as well (for container registries
that are not at "/"). Returns an error if the registry Url is malformed.
Construct a new Client to communicate with container registries . The ` registry_url ` must have an authority component and can optionally include a base path as well ( for container registries that are not at " / " ) . Returns an error if the registry Url is malformed .
pub fn new(scheme: &str, registry_url: &str, creds: Credentials) -> Result<Client> {
        let registry_url = scheme.to_string() + "://" + registry_url;
        let registry_base = registry_url
            .parse::<Url>()
            .context(ErrorKind::ClientRegistryUrlMalformed)?;
        if !registry_base.has_host() {
            return Err(ErrorKind::ClientRegistryUrlMissingAuthority.into());
        }
        if registry_base.query().is_some() {
            return Err(ErrorKind::ClientRegistryUrlIncludesQuery.into());
        }
        Ok(Client {
            client: AuthClient::new(ReqwestClient::new(), creds),
            registry_base,
            supports_range_header: Mutex::new(None),
        })
    }
pub fn new ( scheme : & str , registry_url : & str , creds : Credentials ) -> Result < Client > { let registry_url = scheme . to_string ( ) + " " + registry_url ; let registry_base = registry_url . parse :: < Url > ( ) . context ( ErrorKind :: ClientRegistryUrlMalformed ) ? ; if ! registry_base . has_host ( ) { return Err ( ErrorKind :: ClientRegistryUrlMissingAuthority . into ( ) ) ; } if registry_base . query ( ) . is_some ( ) { return Err ( ErrorKind :: ClientRegistryUrlIncludesQuery . into ( ) ) ; } Ok ( Client { client : AuthClient :: new ( ReqwestClient :: new ( ) , creds ) , registry_base , supports_range_header : Mutex :: new ( None ) , } ) }
Construct a new Client to communicate with container registries.
Construct a new Client to communicate with container registries .
scheme
&str
registry_url
&str
creds
Credentials
scheme
&str
registry_url
&str
creds
Credentials