[][src]Struct mailin_embedded::Server

pub struct Server<H> where
    H: Handler + Clone + Send + 'static, 
{ /* fields omitted */ }

Server is used to configure and start the SMTP server

Methods

impl<H> Server<H> where
    H: Handler + Clone + Send + 'static, 
[src]

pub fn new(handler: H) -> Self[src]

Create a new server with the given Handler

pub fn with_name<S>(&mut self, name: S) -> &mut Self where
    S: Into<String>, 
[src]

Give the server a name

pub fn with_ssl(&mut self, ssl_config: SslConfig) -> Result<&mut Self, Error>[src]

Set the SSL configuration of the server

pub fn with_num_threads(&mut self, num_threads: usize) -> &mut Self[src]

Set the size of the threadpool which is equal to the maximum number of concurrent SMTP sessions.

pub fn with_auth(&mut self, auth: AuthMechanism) -> &mut Self[src]

Add an authentication mechanism that will supported by the server

pub fn with_tcp_listener(&mut self, listener: TcpListener) -> &mut Self[src]

Set a tcp listener from an already open socket

pub fn with_addr<A: ToSocketAddrs>(
    &mut self,
    addr: A
) -> Result<&mut Self, Error>
[src]

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")?;

pub fn serve(self) -> Result<RunningServer, Error>[src]

Start the SMTP server in a background thread

pub fn serve_forever(self) -> Result<(), Error>[src]

Start the SMTP server and run forever

Auto Trait Implementations

impl<H> Send for Server<H>

impl<H> Unpin for Server<H> where
    H: Unpin

impl<H> Sync for Server<H> where
    H: Sync

impl<H> UnwindSafe for Server<H> where
    H: UnwindSafe

impl<H> RefUnwindSafe for Server<H> where
    H: RefUnwindSafe

Blanket Implementations

impl<T> From<T> 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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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