pub enum DataMessageFilter {
Always,
Never,
Command(String),
FieldValue {
name: String,
value: Value,
},
Custom(Box<dyn Fn(&StreamDataMessage) -> bool + Send + Sync>),
All(Vec<DataMessageFilter>),
Any(Vec<DataMessageFilter>),
}
Variants§
Always
Always true
Never
Always false
Command(String)
Command name must match
FieldValue
Value of field in data
must match
Return true if and only if the data
field is type of Object::Value
, contains key
defined by name
and the field is equal to value
.
Custom(Box<dyn Fn(&StreamDataMessage) -> bool + Send + Sync>)
Apply custom filter fn
All(Vec<DataMessageFilter>)
All inner filters must match. If list of predicates is empty, return true.
Any(Vec<DataMessageFilter>)
Any inner filter must match. If list of predicates is empty, return false
Implementations§
Source§impl DataMessageFilter
impl DataMessageFilter
Sourcepub fn test_message(&self, msg: &StreamDataMessage) -> bool
pub fn test_message(&self, msg: &StreamDataMessage) -> bool
Return true if the filter match, return false otherwise.
Trait Implementations§
Source§impl Default for DataMessageFilter
impl Default for DataMessageFilter
Source§fn default() -> DataMessageFilter
fn default() -> DataMessageFilter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DataMessageFilter
impl !RefUnwindSafe for DataMessageFilter
impl Send for DataMessageFilter
impl Sync for DataMessageFilter
impl Unpin for DataMessageFilter
impl !UnwindSafe for DataMessageFilter
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