pub struct DebugEvent { /* private fields */ }Expand description
A builder for constructing debug output with optional JSON fields
Implementations§
Source§impl DebugEvent
impl DebugEvent
Sourcepub fn new(category: Category, event: &'static str, tag: &'static str) -> Self
pub fn new(category: Category, event: &'static str, tag: &'static str) -> Self
Create a new debug event
Sourcepub fn text(self, message: impl Into<String>) -> Self
pub fn text(self, message: impl Into<String>) -> Self
Add a text message (for human-readable output)
Sourcepub fn field(self, name: impl Into<String>, value: JsonValue) -> Self
pub fn field(self, name: impl Into<String>, value: JsonValue) -> Self
Add a JSON field (for machine-readable output)
Sourcepub fn field_str(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn field_str( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
Add a string field
Sourcepub fn field_float(self, name: impl Into<String>, value: f64) -> Self
pub fn field_float(self, name: impl Into<String>, value: f64) -> Self
Add a float field
Sourcepub fn field_bool(self, name: impl Into<String>, value: bool) -> Self
pub fn field_bool(self, name: impl Into<String>, value: bool) -> Self
Add a boolean field
Sourcepub fn field_duration_us(
self,
name: impl Into<String>,
duration: Duration,
) -> Self
pub fn field_duration_us( self, name: impl Into<String>, duration: Duration, ) -> Self
Add duration in microseconds
Sourcepub fn field_duration_ms(
self,
name: impl Into<String>,
duration: Duration,
) -> Self
pub fn field_duration_ms( self, name: impl Into<String>, duration: Duration, ) -> Self
Add duration in milliseconds (as float)
Sourcepub fn field_str_array(self, name: impl Into<String>, values: &[String]) -> Self
pub fn field_str_array(self, name: impl Into<String>, values: &[String]) -> Self
Add a string array field
Auto Trait Implementations§
impl Freeze for DebugEvent
impl RefUnwindSafe for DebugEvent
impl Send for DebugEvent
impl Sync for DebugEvent
impl Unpin for DebugEvent
impl UnwindSafe for DebugEvent
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more