pub struct Record<'a> { /* private fields */ }
Expand description
Represents a log record.
Use
Record
structures are passed as arguments to methods Logger::log
.
Loggers forward these structures to its sinks, then sink implementors
manipulate these structures in order to process log records. Record
s are
automatically created by log macros and so are not seen by log users.
Implementations
sourceimpl<'a> Record<'a>
impl<'a> Record<'a>
sourcepub fn new<S>(level: Level, payload: S) -> Record<'a> where
S: Into<Cow<'a, str>>,
pub fn new<S>(level: Level, payload: S) -> Record<'a> where
S: Into<Cow<'a, str>>,
Constructs a Record
.
Typically users should only use it for testing Sink
.
sourcepub fn builder<S>(level: Level, payload: S) -> RecordBuilder<'a> where
S: Into<Cow<'a, str>>,
pub fn builder<S>(level: Level, payload: S) -> RecordBuilder<'a> where
S: Into<Cow<'a, str>>,
Constructs a RecordBuilder
.
Typically users should only use it for testing Sink
.
sourcepub fn logger_name(&self) -> Option<&'a str>
pub fn logger_name(&self) -> Option<&'a str>
Gets the logger name.
sourcepub fn source_location(&self) -> Option<&SourceLocation>
pub fn source_location(&self) -> Option<&SourceLocation>
Gets the source location.
sourcepub fn time(&self) -> SystemTime
pub fn time(&self) -> SystemTime
Gets the time when the record was created.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Record<'a>
impl<'a> Send for Record<'a>
impl<'a> Sync for Record<'a>
impl<'a> Unpin for Record<'a>
impl<'a> UnwindSafe for Record<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more