Struct vfs_https::HttpsFSServerBuilder [−][src]
Helper structure for building HttpsFS structs
Implementations
impl<T: FileSystem> HttpsFSServerBuilder<T>
[src]
pub fn new(fs: T) -> Self
[src]
Creates a new builder for a HttpsFSServer.
Takes a FileSystem as argument, which will exposed via HTTPS.
pub fn set_port(self, port: u16) -> Self
[src]
Sets the port on which the server will listen.
pub fn load_private_key(self, private_key: &str) -> Self
[src]
Loads a private key from file.
The argument ‘private_key’ is the path to the file containing the private key.
pub fn load_certificates(self, certs: &str) -> Self
[src]
Loads the certificate from a file.
The argument ‘certs’ is the path to the file containing a certificate.
pub fn set_credential_validator(
self,
credential_validator: fn(user: &str, password: &str) -> bool
) -> Self
[src]
self,
credential_validator: fn(user: &str, password: &str) -> bool
) -> Self
Sets a function, which serves as a credential validator.
pub fn run(self) -> HttpsFSResult<()>
[src]
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> RefUnwindSafe for HttpsFSServerBuilder<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for HttpsFSServerBuilder<T>
impl<T> Sync for HttpsFSServerBuilder<T>
impl<T> Unpin for HttpsFSServerBuilder<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for HttpsFSServerBuilder<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,