Struct EnvelopeFilterCallbacks
pub struct EnvelopeFilterCallbacks<F, C> { /* private fields */ }Expand description
A container for callbacks that can be passed to Envelope::filter.
Implementations§
§impl<F, C> EnvelopeFilterCallbacks<F, C>
impl<F, C> EnvelopeFilterCallbacks<F, C>
pub fn new(filter: F, on_filtered: C) -> EnvelopeFilterCallbacks<F, C>
pub fn new(filter: F, on_filtered: C) -> EnvelopeFilterCallbacks<F, C>
Create a new EnvelopeFilterCallbacks.
filter will be called to determine whether the envelope items should be kept.
on_filtered will be called on all envelope items which are then dropped.
Trait Implementations§
§impl<F, C> EnvelopeFilter for EnvelopeFilterCallbacks<F, C>
impl<F, C> EnvelopeFilter for EnvelopeFilterCallbacks<F, C>
§fn filter(&mut self, item: &EnvelopeItem) -> bool
fn filter(&mut self, item: &EnvelopeItem) -> bool
The function used to filter the envelopes. Read more
§fn on_filtered(&mut self, item: EnvelopeItem)
fn on_filtered(&mut self, item: EnvelopeItem)
A callback which is called with all items removed by filtering, including items for which
Self::filter had returned true, such as no-longer-applicable attachments.Auto Trait Implementations§
impl<F, C> Freeze for EnvelopeFilterCallbacks<F, C>
impl<F, C> RefUnwindSafe for EnvelopeFilterCallbacks<F, C>where
F: RefUnwindSafe,
C: RefUnwindSafe,
impl<F, C> Send for EnvelopeFilterCallbacks<F, C>
impl<F, C> Sync for EnvelopeFilterCallbacks<F, C>
impl<F, C> Unpin for EnvelopeFilterCallbacks<F, C>
impl<F, C> UnsafeUnpin for EnvelopeFilterCallbacks<F, C>where
F: UnsafeUnpin,
C: UnsafeUnpin,
impl<F, C> UnwindSafe for EnvelopeFilterCallbacks<F, C>where
F: UnwindSafe,
C: UnwindSafe,
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