[−][src]Struct tide_rustls::TlsListenerBuilder
A builder for TlsListeners
This is created with a call to
TlsListener::build
. This also can
be passed directly to tide::Server::listen
, skipping the
TlsListenerBuilder::finish
call.
Examples
let listener = TlsListener::<()>::build() .addrs("localhost:4433") .cert("./tls/localhost-4433.cert") .key("./tls/localhost-4433.key") .finish();
let listener = TlsListener::<()>::build() .tcp(std::net::TcpListener::bind("localhost:4433").unwrap()) .config(rustls::ServerConfig::new(rustls::NoClientAuth::new())) .finish();
Implementations
impl<State> TlsListenerBuilder<State>
[src]
pub fn key(self, path: impl AsRef<Path>) -> Self
[src]
Provide a path to a key file, in either pkcs8 or rsa
formats. This is mutually exclusive with providing a server
config with TlsListenerBuilder::config
, but must be used
in conjunction with TlsListenerBuilder::cert
pub fn cert(self, path: impl AsRef<Path>) -> Self
[src]
Provide a path to a cert file. This is mutually exclusive with
providing a server config with TlsListenerBuilder::config
,
but must be used in conjunction with
TlsListenerBuilder::key
pub fn config(self, config: ServerConfig) -> Self
[src]
Provide a prebuilt
rustls::ServerConfig
with any
options. This is mutually exclusive with both
TlsListenerBuilder::key
and TlsListenerBuilder::cert
,
but provides the opportunity for more configuration choices.
pub fn tcp(self, tcp: impl Into<TcpListener>) -> Self
[src]
Provides a bound tcp listener (either async-std or std) to
build this tls listener on. This is mutually exclusive with
TlsListenerBuilder::addrs
, but one of them is mandatory.
pub fn addrs(self, addrs: impl ToSocketAddrs) -> Self
[src]
Provides a std::net::ToSocketAddrs
specification for this
tls listener. This is mutually exclusive with
TlsListenerBuilder::tcp
but one of them is mandatory.
pub fn finish(self) -> Result<TlsListener<State>>
[src]
finishes building a TlsListener from this TlsListenerBuilder.
Errors
this will return an error unless all of the following conditions are met:
- either of these is provided, but not both
- either of these is provided, but not both
Trait Implementations
impl<State> Debug for TlsListenerBuilder<State>
[src]
impl<State> Default for TlsListenerBuilder<State>
[src]
impl<State: Clone + Send + Sync + 'static> ToListener<State> for TlsListenerBuilder<State>
[src]
type Listener = TlsListener<State>
What listener are we converting into?
pub fn to_listener(self) -> Result<Self::Listener>
[src]
Auto Trait Implementations
impl<State> !RefUnwindSafe for TlsListenerBuilder<State>
impl<State> Send for TlsListenerBuilder<State> where
State: Send,
State: Send,
impl<State> Sync for TlsListenerBuilder<State> where
State: Sync,
State: Sync,
impl<State> Unpin for TlsListenerBuilder<State> where
State: Unpin,
State: Unpin,
impl<State> !UnwindSafe for TlsListenerBuilder<State>
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, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
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>,