pub struct SmtpClientOptions { /* private fields */ }Expand description
Options for configuring an SmtpClient before connecting.
Provides a send-policy hook (RFC 011) and an audit-event sink (RFC 012). All settings are optional; the defaults are permissive and silent.
§Example
use wasm_smtp::policy::BoundedPolicy;
use wasm_smtp::audit::VecAuditSink;
use wasm_smtp::SmtpClientOptions;
use std::sync::Arc;
let sink = Arc::new(VecAuditSink::default());
let opts = SmtpClientOptions::new()
.with_policy(Box::new(BoundedPolicy::new().max_recipients(25)))
.with_audit(Box::new(Arc::clone(&sink)));Implementations§
Source§impl SmtpClientOptions
impl SmtpClientOptions
Sourcepub fn with_policy(self, policy: Box<dyn SendPolicy>) -> Self
pub fn with_policy(self, policy: Box<dyn SendPolicy>) -> Self
Attach a SendPolicy.
Sourcepub fn with_audit(self, audit: Box<dyn AuditSink>) -> Self
pub fn with_audit(self, audit: Box<dyn AuditSink>) -> Self
Attach an AuditSink.
Trait Implementations§
Source§impl Debug for SmtpClientOptions
impl Debug for SmtpClientOptions
Auto Trait Implementations§
impl Freeze for SmtpClientOptions
impl !RefUnwindSafe for SmtpClientOptions
impl Send for SmtpClientOptions
impl Sync for SmtpClientOptions
impl Unpin for SmtpClientOptions
impl UnsafeUnpin for SmtpClientOptions
impl !UnwindSafe for SmtpClientOptions
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