pub struct SmtpSpecRegistry { /* private fields */ }Expand description
SMTP protocol registry implementing SpecRegistry trait
Implementations§
Source§impl SmtpSpecRegistry
impl SmtpSpecRegistry
Sourcepub fn with_mailbox_size(max_size: usize) -> Self
pub fn with_mailbox_size(max_size: usize) -> Self
Create a new registry with custom mailbox size
Sourcepub fn load_fixtures<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
pub fn load_fixtures<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
Load fixtures from a directory
Sourcepub fn find_matching_fixture(
&self,
from: &str,
to: &str,
subject: &str,
) -> Option<&SmtpFixture>
pub fn find_matching_fixture( &self, from: &str, to: &str, subject: &str, ) -> Option<&SmtpFixture>
Find a matching fixture for the given email
Sourcepub fn store_email(&self, email: StoredEmail) -> Result<()>
pub fn store_email(&self, email: StoredEmail) -> Result<()>
Store an email in the mailbox
Sourcepub fn get_emails(&self) -> Result<Vec<StoredEmail>>
pub fn get_emails(&self) -> Result<Vec<StoredEmail>>
Get all emails from the mailbox
Sourcepub fn get_email_by_id(&self, id: &str) -> Result<Option<StoredEmail>>
pub fn get_email_by_id(&self, id: &str) -> Result<Option<StoredEmail>>
Get a specific email by ID
Sourcepub fn clear_mailbox(&self) -> Result<()>
pub fn clear_mailbox(&self) -> Result<()>
Clear all emails from the mailbox
Sourcepub fn get_mailbox_stats(&self) -> Result<MailboxStats>
pub fn get_mailbox_stats(&self) -> Result<MailboxStats>
Get mailbox statistics
Sourcepub fn search_emails(
&self,
filters: EmailSearchFilters,
) -> Result<Vec<StoredEmail>>
pub fn search_emails( &self, filters: EmailSearchFilters, ) -> Result<Vec<StoredEmail>>
Search emails with filters
Trait Implementations§
Source§impl Default for SmtpSpecRegistry
impl Default for SmtpSpecRegistry
Source§impl SpecRegistry for SmtpSpecRegistry
impl SpecRegistry for SmtpSpecRegistry
Source§fn operations(&self) -> Vec<SpecOperation>
fn operations(&self) -> Vec<SpecOperation>
Get all available operations/routes in this spec
Source§fn find_operation(&self, operation: &str, path: &str) -> Option<SpecOperation>
fn find_operation(&self, operation: &str, path: &str) -> Option<SpecOperation>
Find an operation by path/name
Source§fn validate_request(
&self,
request: &ProtocolRequest,
) -> Result<ValidationResult>
fn validate_request( &self, request: &ProtocolRequest, ) -> Result<ValidationResult>
Validate a request against the spec
Source§fn generate_mock_response(
&self,
request: &ProtocolRequest,
) -> Result<ProtocolResponse>
fn generate_mock_response( &self, request: &ProtocolRequest, ) -> Result<ProtocolResponse>
Generate a mock response for a request
Auto Trait Implementations§
impl !Freeze for SmtpSpecRegistry
impl RefUnwindSafe for SmtpSpecRegistry
impl Send for SmtpSpecRegistry
impl Sync for SmtpSpecRegistry
impl Unpin for SmtpSpecRegistry
impl UnwindSafe for SmtpSpecRegistry
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