pub struct EventState {
pub policy: Policy,
pub counter: SuppressionCounter,
pub metadata: Option<EventMetadata>,
}Expand description
State tracked for each event signature.
Fields§
§policy: PolicyRate limiting policy for this event
counter: SuppressionCounterCounter tracking suppressions
metadata: Option<EventMetadata>Metadata about the event (for human-readable summaries)
Implementations§
Source§impl EventState
impl EventState
Sourcepub fn new(policy: Policy, initial_timestamp: Instant) -> Self
pub fn new(policy: Policy, initial_timestamp: Instant) -> Self
Create new event state with a policy.
Sourcepub fn new_with_metadata(
policy: Policy,
initial_timestamp: Instant,
metadata: EventMetadata,
) -> Self
pub fn new_with_metadata( policy: Policy, initial_timestamp: Instant, metadata: EventMetadata, ) -> Self
Create new event state with metadata.
Sourcepub fn set_metadata(&mut self, metadata: EventMetadata)
pub fn set_metadata(&mut self, metadata: EventMetadata)
Update or set the event metadata.
This is called on first occurrence to capture event details.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for EventState
impl RefUnwindSafe for EventState
impl Send for EventState
impl Sync for EventState
impl Unpin for EventState
impl UnwindSafe for EventState
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