pub struct MockServer { /* private fields */ }
Expand description
A mock SMTP server.
Implementations§
Source§impl MockServer
impl MockServer
Sourcepub fn new(domain: &str) -> Self
pub fn new(domain: &str) -> Self
Creates a MockServer with the given domain. The domain is only used for the ready message and EHLO/HELO replies.
Sourcepub fn set_require_tls(&mut self)
pub fn set_require_tls(&mut self)
Sets the server to require TLS. This command has no effect on a server that has already started.
Sourcepub fn set_no_verify_credentials(&mut self)
pub fn set_no_verify_credentials(&mut self)
Sets the server to not verify credentials from AUTH commands. This command has no effect on a server that has already started.
Sourcepub fn add_mailbox(&mut self, user: &str, password: &str)
pub fn add_mailbox(&mut self, user: &str, password: &str)
Adds a mailbox with the given user and password to the server.
Sourcepub fn assert(&self, assertion: MailAssertion) -> bool
pub fn assert(&self, assertion: MailAssertion) -> bool
Asserts the given assertion against the server.
Trait Implementations§
Source§impl Clone for MockServer
impl Clone for MockServer
Source§fn clone(&self) -> MockServer
fn clone(&self) -> MockServer
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 Freeze for MockServer
impl !RefUnwindSafe for MockServer
impl Send for MockServer
impl Sync for MockServer
impl Unpin for MockServer
impl !UnwindSafe for MockServer
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