pub struct SmtpPool { /* private fields */ }Expand description
Connection pool for SMTP clients
Implementations§
Source§impl SmtpPool
impl SmtpPool
Sourcepub fn new(host: String, port: u16, max_connections: usize) -> Self
pub fn new(host: String, port: u16, max_connections: usize) -> Self
Creates a new connection pool
Sourcepub fn with_security(
host: String,
port: u16,
security: SmtpSecurity,
max_connections: usize,
) -> Self
pub fn with_security( host: String, port: u16, security: SmtpSecurity, max_connections: usize, ) -> Self
Creates pool with security
Sourcepub async fn acquire(&mut self) -> Result<SmtpClient>
pub async fn acquire(&mut self) -> Result<SmtpClient>
Acquires a connection from the pool
Sourcepub fn release(&mut self, client: SmtpClient)
pub fn release(&mut self, client: SmtpClient)
Returns a connection to the pool
Auto Trait Implementations§
impl Freeze for SmtpPool
impl RefUnwindSafe for SmtpPool
impl Send for SmtpPool
impl Sync for SmtpPool
impl Unpin for SmtpPool
impl UnsafeUnpin for SmtpPool
impl UnwindSafe for SmtpPool
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