pub struct EventPattern {
pub event_type: Option<String>,
pub required_fields: HashMap<String, Value>,
pub source: Option<String>,
}Expand description
Pattern for matching events
Fields§
§event_type: Option<String>Expected event type (optional)
required_fields: HashMap<String, Value>Required data fields with expected values
source: Option<String>Expected source (optional)
Implementations§
Source§impl EventPattern
impl EventPattern
Sourcepub fn with_event_type(self, event_type: impl Into<String>) -> Self
pub fn with_event_type(self, event_type: impl Into<String>) -> Self
Set expected event type
Sourcepub fn with_field(self, key: impl Into<String>, value: Value) -> Self
pub fn with_field(self, key: impl Into<String>, value: Value) -> Self
Add required field
Sourcepub fn with_source(self, source: impl Into<String>) -> Self
pub fn with_source(self, source: impl Into<String>) -> Self
Set expected source
Trait Implementations§
Source§impl Clone for EventPattern
impl Clone for EventPattern
Source§fn clone(&self) -> EventPattern
fn clone(&self) -> EventPattern
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 EventPattern
impl Debug for EventPattern
Auto Trait Implementations§
impl Freeze for EventPattern
impl RefUnwindSafe for EventPattern
impl Send for EventPattern
impl Sync for EventPattern
impl Unpin for EventPattern
impl UnwindSafe for EventPattern
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