pub struct MessageFilter {
pub message_type: Option<MessageType>,
pub source_pattern: Option<String>,
pub target_pattern: Option<String>,
pub min_priority: Option<MessagePriority>,
pub content_pattern: Option<String>,
pub max_age_seconds: Option<u64>,
}
Expand description
Message filter for selective message processing
Fields§
§message_type: Option<MessageType>
Filter by message type
source_pattern: Option<String>
Filter by source node pattern
target_pattern: Option<String>
Filter by target node pattern
min_priority: Option<MessagePriority>
Filter by minimum priority
content_pattern: Option<String>
Filter by content pattern
max_age_seconds: Option<u64>
Filter by age (max seconds)
Implementations§
Source§impl MessageFilter
impl MessageFilter
Sourcepub fn with_type(self, message_type: MessageType) -> Self
pub fn with_type(self, message_type: MessageType) -> Self
Filter by message type
Sourcepub fn with_source(self, pattern: String) -> Self
pub fn with_source(self, pattern: String) -> Self
Filter by source pattern
Sourcepub fn with_target(self, pattern: String) -> Self
pub fn with_target(self, pattern: String) -> Self
Filter by target pattern
Sourcepub fn with_min_priority(self, priority: MessagePriority) -> Self
pub fn with_min_priority(self, priority: MessagePriority) -> Self
Filter by minimum priority
Sourcepub fn with_content(self, pattern: String) -> Self
pub fn with_content(self, pattern: String) -> Self
Filter by content pattern
Sourcepub fn with_max_age(self, seconds: u64) -> Self
pub fn with_max_age(self, seconds: u64) -> Self
Filter by maximum age
Sourcepub fn matches(&self, message: &OdinMessage) -> bool
pub fn matches(&self, message: &OdinMessage) -> bool
Check if message matches the filter
Trait Implementations§
Source§impl Clone for MessageFilter
impl Clone for MessageFilter
Source§fn clone(&self) -> MessageFilter
fn clone(&self) -> MessageFilter
Returns a duplicate of the value. Read more
1.0.0 · 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 MessageFilter
impl Debug for MessageFilter
Auto Trait Implementations§
impl Freeze for MessageFilter
impl RefUnwindSafe for MessageFilter
impl Send for MessageFilter
impl Sync for MessageFilter
impl Unpin for MessageFilter
impl UnwindSafe for MessageFilter
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