[−][src]Struct mailin_embedded::Server
Server
is used to configure and start the SMTP server
Methods
impl<H> Server<H> where
H: Handler + Clone + Send + 'static,
[src]
H: Handler + Clone + Send + 'static,
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]
S: Into<String>,
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]
&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")?;
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,
H: Unpin,
impl<H> Sync for Server<H> where
H: Sync,
H: Sync,
impl<H> UnwindSafe for Server<H> where
H: UnwindSafe,
H: UnwindSafe,
impl<H> RefUnwindSafe for Server<H> where
H: RefUnwindSafe,
H: RefUnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,