Trait mailpot::message_filters::PostFilter
source · pub trait PostFilter {
// Required method
fn feed<'p, 'list>(
self: Box<Self>,
post: &'p mut PostEntry,
ctx: &'p mut ListContext<'list>
) -> Result<(&'p mut PostEntry, &'p mut ListContext<'list>), ()>;
}
Expand description
Filter that modifies and/or verifies a post candidate. On rejection, return
a string describing the error and optionally set post.action
to Reject
or Defer
Required Methods§
sourcefn feed<'p, 'list>(
self: Box<Self>,
post: &'p mut PostEntry,
ctx: &'p mut ListContext<'list>
) -> Result<(&'p mut PostEntry, &'p mut ListContext<'list>), ()>
fn feed<'p, 'list>( self: Box<Self>, post: &'p mut PostEntry, ctx: &'p mut ListContext<'list> ) -> Result<(&'p mut PostEntry, &'p mut ListContext<'list>), ()>
Feed post into the filter. Perform modifications to post
and / or
ctx
, and return them with Result::Ok
unless you want to the
processing to stop and return an Result::Err
.