pub struct TlsServer { /* private fields */ }
Expand description
Primary class for creating and connecting serverside TLS sockets
Implementations§
Source§impl TlsServer
impl TlsServer
Sourcepub async fn new<T, U, V>(
interface: T,
cert_file: U,
key_file: V,
) -> Result<Self>
pub async fn new<T, U, V>( interface: T, cert_file: U, key_file: V, ) -> Result<Self>
Creates a new TlsServer
struct instance. This call will load
certificates and private keys from the provided file paths, then
resolve the interface/port combination provided. If this succeeds, a
rustls ServerConfig
structure is built internally that uses default
settings using the first private key from the key_file. The address
binding and listening occurs later when TlsServer::listen
is
called.
Sourcepub async fn listen(&self) -> Result<TlsListener>
pub async fn listen(&self) -> Result<TlsListener>
Starts the listening side of the server socket, returning a TlsListener
Sourcepub fn get_interface(&self) -> &String
pub fn get_interface(&self) -> &String
Returns the interface string that was used during creation
Auto Trait Implementations§
impl Freeze for TlsServer
impl !RefUnwindSafe for TlsServer
impl Send for TlsServer
impl Sync for TlsServer
impl Unpin for TlsServer
impl !UnwindSafe for TlsServer
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