pub struct EmailPredicate {
pub mailbox_id: Option<String>,
pub from: Option<String>,
pub from_regex: Option<String>,
pub to: Option<String>,
pub subject: Option<String>,
pub subject_regex: Option<String>,
pub body_contains: Option<String>,
pub body_regex: Option<String>,
pub has_attachment: Option<bool>,
pub headers: Vec<HeaderPredicate>,
}Fields§
§mailbox_id: Option<String>Restrict to a single mailbox.
from: Option<String>Sender substring (case-insensitive).
from_regex: Option<String>Sender regex.
to: Option<String>Any recipient contains this substring (case-insensitive).
subject: Option<String>Subject substring (case-insensitive).
subject_regex: Option<String>Subject regex.
body_contains: Option<String>Plain-text body substring.
body_regex: Option<String>Plain-text body regex.
has_attachment: Option<bool>Some(true) requires at least one attachment; Some(false)
requires zero. None means “don’t care”.
headers: Vec<HeaderPredicate>Per-header predicates (any combination of substring/regex).
Implementations§
Source§impl EmailPredicate
impl EmailPredicate
Sourcepub fn matches_summary(&self, s: &EmailSummary) -> bool
pub fn matches_summary(&self, s: &EmailSummary) -> bool
True if the predicate could possibly match — used for cheap
filtering against an EmailSummary before paying the cost of
fetching the full detail.
Sourcepub fn check(&self, d: &EmailDetail) -> MatchResult
pub fn check(&self, d: &EmailDetail) -> MatchResult
Full check against a parsed detail. Populates mismatches
with one human-readable line per failed clause; an empty
mismatches means the predicate matched.
Trait Implementations§
Source§impl Clone for EmailPredicate
impl Clone for EmailPredicate
Source§fn clone(&self) -> EmailPredicate
fn clone(&self) -> EmailPredicate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EmailPredicate
impl Debug for EmailPredicate
Source§impl Default for EmailPredicate
impl Default for EmailPredicate
Source§fn default() -> EmailPredicate
fn default() -> EmailPredicate
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for EmailPredicate
impl<'de> Deserialize<'de> for EmailPredicate
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for EmailPredicate
impl RefUnwindSafe for EmailPredicate
impl Send for EmailPredicate
impl Sync for EmailPredicate
impl Unpin for EmailPredicate
impl UnsafeUnpin for EmailPredicate
impl UnwindSafe for EmailPredicate
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more