Struct mailin::SessionBuilder
source · pub struct SessionBuilder { /* private fields */ }
Expand description
Builds an smtp Session
§Examples
// Create a session builder that holds the configuration
let mut builder = SessionBuilder::new("server_name");
builder.enable_start_tls()
.enable_auth(AuthMechanism::Plain);
// Then when a client connects
let mut session = builder.build(addr, handler);
Implementations§
source§impl SessionBuilder
impl SessionBuilder
sourcepub fn new<S: Into<String>>(name: S) -> Self
pub fn new<S: Into<String>>(name: S) -> Self
Create a new session for the given mailserver name
sourcepub fn enable_start_tls(&mut self) -> &mut Self
pub fn enable_start_tls(&mut self) -> &mut Self
Enable support for StartTls
sourcepub fn enable_auth(&mut self, auth: AuthMechanism) -> &mut Self
pub fn enable_auth(&mut self, auth: AuthMechanism) -> &mut Self
Enable support for authentication
Trait Implementations§
source§impl Clone for SessionBuilder
impl Clone for SessionBuilder
source§fn clone(&self) -> SessionBuilder
fn clone(&self) -> SessionBuilder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for SessionBuilder
impl Send for SessionBuilder
impl Sync for SessionBuilder
impl Unpin for SessionBuilder
impl UnwindSafe for SessionBuilder
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