Struct salvo::TlsServer[][src]

pub struct TlsServer { /* fields omitted */ }

Implementations

impl TlsServer[src]

pub fn key_path(self, path: impl AsRef<Path>) -> TlsServer[src]

Specify the file path to read the private key.

This function requires the "tls" feature.

pub fn cert_path(self, path: impl AsRef<Path>) -> TlsServer[src]

Specify the file path to read the certificate.

This function requires the "tls" feature.

pub fn client_auth_optional_path(self, path: impl AsRef<Path>) -> TlsServer[src]

Specify the file path to read the trust anchor for optional client authentication.

Anonymous and authenticated clients will be accepted. If no trust anchor is provided by any of the client_auth_ methods, then client authentication is disabled by default.

This function requires the "tls" feature.

pub fn client_auth_required_path(self, path: impl AsRef<Path>) -> TlsServer[src]

Specify the file path to read the trust anchor for required client authentication.

Only authenticated clients will be accepted. If no trust anchor is provided by any of the client_auth_ methods, then client authentication is disabled by default.

This function requires the "tls" feature.

pub fn key(self, key: impl AsRef<[u8]>) -> TlsServer[src]

Specify the in-memory contents of the private key.

This function requires the "tls" feature.

pub fn cert(self, cert: impl AsRef<[u8]>) -> TlsServer[src]

Specify the in-memory contents of the certificate.

This function requires the "tls" feature.

pub fn client_auth_optional(self, trust_anchor: impl AsRef<[u8]>) -> TlsServer[src]

Specify the in-memory contents of the trust anchor for optional client authentication.

Anonymous and authenticated clients will be accepted. If no trust anchor is provided by any of the client_auth_ methods, then client authentication is disabled by default.

This function requires the "tls" feature.

pub fn client_auth_required(self, trust_anchor: impl AsRef<[u8]>) -> TlsServer[src]

Specify the in-memory contents of the trust anchor for required client authentication.

Only authenticated clients will be accepted. If no trust anchor is provided by any of the client_auth_ methods, then client authentication is disabled by default.

This function requires the "tls" feature.

pub fn ocsp_resp(self, resp: impl AsRef<[u8]>) -> TlsServer[src]

Specify the DER-encoded OCSP response.

This function requires the "tls" feature.

pub fn start(self, addr: impl Into<SocketAddr> + 'static)[src]

pub fn start_with_threads(
    self,
    addr: impl Into<SocketAddr> + 'static,
    threads: usize
)
[src]

pub async fn bind(self, addr: impl Into<SocketAddr> + 'static)[src]

Bind to a socket address, returning a Future that can be executed on a runtime.

This function requires the "tls" feature.

pub async fn try_bind(
    self,
    addr: impl Into<SocketAddr>
) -> Result<SocketAddr, Error>
[src]

Bind to a socket address, returning a Future that can be executed on any runtime.

In case we are unable to bind to the specified address, resolves to an error and logs the reason.

This function requires the "tls" feature.

pub async fn try_bind_with_graceful_shutdown(
    self,
    addr: impl Into<SocketAddr> + 'static,
    signal: impl Future<Output = ()> + Send + 'static
) -> Result<SocketAddr, Error>
[src]

Create a server with graceful shutdown signal.

When the signal completes, the server will start the graceful shutdown process.

This function requires the "tls" feature.

Auto Trait Implementations

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> Same<T> for T

type Output = T

Should always be Self

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>,