pub struct StructuredEvent {
pub severity: EventSeverity,
pub component: EventComponent,
pub kind: EventKind,
pub message: String,
pub timestamp: Instant,
pub peer_id: Option<PeerId>,
pub addr: Option<SocketAddr>,
pub duration: Option<Duration>,
pub count: Option<u64>,
}Expand description
A structured event with typed fields
Fields§
§severity: EventSeverityEvent severity
component: EventComponentComponent that generated the event
kind: EventKindEvent kind/type
message: StringEvent message
timestamp: InstantTimestamp when event occurred
peer_id: Option<PeerId>Optional peer ID associated with event
addr: Option<SocketAddr>Optional address associated with event
duration: Option<Duration>Optional duration associated with event
count: Option<u64>Optional count/value associated with event
Implementations§
Source§impl StructuredEvent
impl StructuredEvent
Sourcepub fn builder(
component: EventComponent,
kind: EventKind,
) -> StructuredEventBuilder
pub fn builder( component: EventComponent, kind: EventKind, ) -> StructuredEventBuilder
Create a new event builder
Trait Implementations§
Source§impl Clone for StructuredEvent
impl Clone for StructuredEvent
Source§fn clone(&self) -> StructuredEvent
fn clone(&self) -> StructuredEvent
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 moreAuto Trait Implementations§
impl Freeze for StructuredEvent
impl RefUnwindSafe for StructuredEvent
impl Send for StructuredEvent
impl Sync for StructuredEvent
impl Unpin for StructuredEvent
impl UnwindSafe for StructuredEvent
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