pub struct EventRecord {
pub metadata: Option<&'static Metadata<'static>>,
pub fields: FieldList,
pub recorded_at: Option<Instant>,
}Expand description
One captured event. metadata and recorded_at are Option purely
so EventRecord can implement Default for the internal object
pool — they are always Some once an event has been published
through the subscriber. Helper accessors metadata() /
recorded_at() fall back to safe defaults rather than panic.
Fields§
§metadata: Option<&'static Metadata<'static>>§fields: FieldList§recorded_at: Option<Instant>Implementations§
Source§impl EventRecord
impl EventRecord
Sourcepub fn metadata(&self) -> &'static Metadata<'static>
pub fn metadata(&self) -> &'static Metadata<'static>
Metadata pointer. Always Some for events that have been
observed by the subscriber; freshly-acquired pool entries
that haven’t been filled yet fall through to a static
"unfilled" metadata stand-in so consumers don’t need to
guard against None.
Sourcepub fn recorded_at(&self) -> Instant
pub fn recorded_at(&self) -> Instant
Captured Instant for the event. See Self::metadata
for the unfilled-entry behaviour — same shape: returns
the lazy UNFILLED_INSTANT stand-in instead of panicking.
pub fn field(&self, name: &str) -> Option<&FieldValue>
Trait Implementations§
Source§impl Clone for EventRecord
impl Clone for EventRecord
Source§fn clone(&self) -> EventRecord
fn clone(&self) -> EventRecord
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 EventRecord
impl Debug for EventRecord
Source§impl Default for EventRecord
impl Default for EventRecord
Source§fn default() -> EventRecord
fn default() -> EventRecord
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EventRecord
impl !RefUnwindSafe for EventRecord
impl Send for EventRecord
impl Sync for EventRecord
impl Unpin for EventRecord
impl UnsafeUnpin for EventRecord
impl !UnwindSafe for EventRecord
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