pub struct Event {
pub kind: &'static str,
pub at: SystemTime,
pub duration: Option<Duration>,
pub fields: BTreeMap<String, Json>,
}Expand description
One recorded moment: a request, a query, a dispatched job, an exception.
Fields§
§kind: &'static strA dotted, stable identifier: http.request, db.query, ai.call.
at: SystemTime§duration: Option<Duration>How long the recorded work took, when it was a span rather than a point.
fields: BTreeMap<String, Json>Implementations§
Source§impl Event
impl Event
pub fn new(kind: &'static str) -> Self
pub fn with(self, key: &str, value: impl Into<Json>) -> Self
pub fn took(self, duration: Duration) -> Self
pub fn field(&self, key: &str) -> Option<&Json>
Sourcepub fn duration_ms(&self) -> Option<f64>
pub fn duration_ms(&self) -> Option<f64>
Milliseconds elapsed, for renderers that show a duration column.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
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