Struct vfs_https::HttpsFSServerBuilder[][src]

pub struct HttpsFSServerBuilder<T: FileSystem> { /* fields omitted */ }

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]

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

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,