pub struct HttpsFSServerBuilder<T: FileSystem> { /* private fields */ }
Expand description
Helper structure for building HttpsFS structs
Implementations§
Source§impl<T: FileSystem> HttpsFSServerBuilder<T>
impl<T: FileSystem> HttpsFSServerBuilder<T>
Sourcepub fn new(fs: T) -> Self
pub fn new(fs: T) -> Self
Creates a new builder for a HttpsFSServer.
Takes a FileSystem as argument, which will exposed via HTTPS.
Sourcepub fn load_private_key(self, private_key: &str) -> Self
pub fn load_private_key(self, private_key: &str) -> Self
Loads a private key from file.
The argument ‘private_key’ is the path to the file containing the private key.
Sourcepub fn load_certificates(self, certs: &str) -> Self
pub fn load_certificates(self, certs: &str) -> Self
Loads the certificate from a file.
The argument ‘certs’ is the path to the file containing a certificate.
Sourcepub fn set_credential_validator(
self,
credential_validator: fn(user: &str, password: &str) -> bool,
) -> Self
pub fn set_credential_validator( self, credential_validator: fn(user: &str, password: &str) -> bool, ) -> Self
Sets a function, which serves as a credential validator.
Sourcepub fn run(self) -> HttpsFSResult<()>
pub fn run(self) -> HttpsFSResult<()>
Starts listening on the configured port.
§Panics
This function panics if one of the following conditions is fulfilled.
- no certificate was set
- no private key was set
- no credential validator was not set
Auto Trait Implementations§
impl<T> Freeze for HttpsFSServerBuilder<T>where
T: Freeze,
impl<T> RefUnwindSafe for HttpsFSServerBuilder<T>where
T: RefUnwindSafe,
impl<T> Send for HttpsFSServerBuilder<T>
impl<T> Sync for HttpsFSServerBuilder<T>
impl<T> Unpin for HttpsFSServerBuilder<T>where
T: Unpin,
impl<T> UnwindSafe for HttpsFSServerBuilder<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more