pub struct DebugMessage {
pub level: DebugLevel,
pub message: String,
pub location: Option<String>,
pub timestamp: DateTime<Utc>,
pub context: HashMap<String, String>,
}Expand description
Debug message
Fields§
§level: DebugLevelMessage level
message: StringMessage text
location: Option<String>Source location
timestamp: DateTime<Utc>Timestamp
context: HashMap<String, String>Additional context
Implementations§
Source§impl DebugMessage
impl DebugMessage
Sourcepub fn new(level: DebugLevel, message: impl Into<String>) -> Self
pub fn new(level: DebugLevel, message: impl Into<String>) -> Self
Create a new debug message
Sourcepub fn with_location(self, location: impl Into<String>) -> Self
pub fn with_location(self, location: impl Into<String>) -> Self
Set location
Sourcepub fn with_context(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_context( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add context
Sourcepub fn format_colored(&self) -> String
pub fn format_colored(&self) -> String
Format as colored string
Trait Implementations§
Source§impl Clone for DebugMessage
impl Clone for DebugMessage
Source§fn clone(&self) -> DebugMessage
fn clone(&self) -> DebugMessage
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 moreSource§impl Debug for DebugMessage
impl Debug for DebugMessage
Source§impl<'de> Deserialize<'de> for DebugMessage
impl<'de> Deserialize<'de> for DebugMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DebugMessage
impl RefUnwindSafe for DebugMessage
impl Send for DebugMessage
impl Sync for DebugMessage
impl Unpin for DebugMessage
impl UnsafeUnpin for DebugMessage
impl UnwindSafe for DebugMessage
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