pub struct Server<H>{ /* private fields */ }
Expand description
Server
is used to configure and start the SMTP server
Implementations§
Source§impl<H> Server<H>
impl<H> Server<H>
Sourcepub fn with_ssl(&mut self, ssl_config: SslConfig) -> Result<&mut Self, Error>
pub fn with_ssl(&mut self, ssl_config: SslConfig) -> Result<&mut Self, Error>
Set the SSL configuration of the server
Sourcepub fn with_num_threads(&mut self, num_threads: u32) -> &mut Self
pub fn with_num_threads(&mut self, num_threads: u32) -> &mut Self
Set the size of the threadpool which is equal to the maximum number of concurrent SMTP sessions.
Sourcepub fn with_auth(&mut self, auth: AuthMechanism) -> &mut Self
pub fn with_auth(&mut self, auth: AuthMechanism) -> &mut Self
Add an authentication mechanism that will supported by the server
Sourcepub fn with_tcp_listener(&mut self, listener: TcpListener) -> &mut Self
pub fn with_tcp_listener(&mut self, listener: TcpListener) -> &mut Self
Set a tcp listener from an already open socket
Sourcepub fn with_addr<A: ToSocketAddrs>(
&mut self,
addr: A,
) -> Result<&mut Self, Error>
pub fn with_addr<A: ToSocketAddrs>( &mut self, addr: A, ) -> Result<&mut Self, Error>
Add ip addresses and ports to listen on. Returns an error if the given socket addresses are not valid.
server.with_addr("127.0.0.1:25")?;
Auto Trait Implementations§
impl<H> Freeze for Server<H>where
H: Freeze,
impl<H> !RefUnwindSafe for Server<H>
impl<H> Send for Server<H>
impl<H> Sync for Server<H>where
H: Sync,
impl<H> Unpin for Server<H>where
H: Unpin,
impl<H> !UnwindSafe for Server<H>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more