pub struct HttpsFSBuilder { /* private fields */ }
Expand description
Helper struct for building HttpsFS structs
Implementations§
Source§impl HttpsFSBuilder
impl HttpsFSBuilder
Sourcepub fn new(domain: &str) -> Self
pub fn new(domain: &str) -> Self
Creates a new builder for a HttpsFS.
Takes a domain name to which the HttpsFS will connect.
Sourcepub fn set_port(self, port: u16) -> Self
pub fn set_port(self, port: u16) -> Self
Set the port, to which the HttpsFS will connect.
Default is 443.
Sourcepub fn set_domain(self, domain: &str) -> Self
pub fn set_domain(self, domain: &str) -> Self
Overwrites the domain name, which was set while creating the builder.
Sourcepub fn add_root_certificate(self, cert: &str) -> Self
pub fn add_root_certificate(self, cert: &str) -> Self
Adds an additional root certificate.
If a self signed certificate is used during, the development, than the certificate has to be added with this call, otherwise the HttpsFS fails to connect to the crate::HttpsFSServer.
Sourcepub fn set_credential_provider(
self,
c_provider: fn(realm: &str) -> (String, String),
) -> Self
pub fn set_credential_provider( self, c_provider: fn(realm: &str) -> (String, String), ) -> Self
If the crate::HttpsFSServer request a authentication, than this function will be called to get the credentials. The first value of the returned tuple is the user name and the second value is the password.
Sourcepub fn build(self) -> HttpsFSResult<HttpsFS>
pub fn build(self) -> HttpsFSResult<HttpsFS>
Generates a HttpsFS with the set configuration
§Error
Returns an error, if the credential provider was not set.