PooledRecord

Struct PooledRecord 

Source
pub struct PooledRecord { /* private fields */ }
Expand description

A record acquired from a pool that will be returned when dropped

Implementations§

Source§

impl PooledRecord

Source

pub fn get_mut(&mut self) -> &mut Record

Get a mutable reference to the record

Source

pub fn get(&self) -> &Record

Get a reference to the record

Source

pub fn into_record(self) -> Record

Take ownership of the record, preventing it from being returned to the pool

Source

pub fn set_level(&mut self, level: LogLevel)

Set the log level

Source

pub fn set_message(&mut self, message: impl Into<String>)

Set the message

Methods from Deref<Target = Record>§

Source

pub fn level(&self) -> LogLevel

Get the log level

Source

pub fn message(&self) -> &str

Get the log message

Source

pub fn module(&self) -> &str

Get the module path

Source

pub fn file(&self) -> &str

Get the file name

Source

pub fn line(&self) -> u32

Get the line number

Source

pub fn timestamp(&self) -> DateTime<Utc>

Get the timestamp

Source

pub fn metadata(&self) -> &HashMap<String, String>

Get the metadata

Source

pub fn context(&self) -> &HashMap<String, Value>

Get the context data

Source

pub fn get_metadata(&self, key: &str) -> Option<&str>

Returns the value associated with the given key, if any.

Source

pub fn get_context(&self, key: &str) -> Option<&Value>

Returns the context value associated with the given key, if any.

Source

pub fn has_context(&self) -> bool

Returns true if the record has any structured context data.

Source

pub fn has_metadata(&self) -> bool

Returns true if the record has any metadata.

Source

pub fn has_formatter(&self) -> bool

Returns true if the record has a deferred formatter.

Source

pub fn context_len(&self) -> usize

Returns the number of context entries in the record.

Source

pub fn metadata_len(&self) -> usize

Returns the number of metadata entries in the record.

Source

pub fn location(&self) -> String

Get the location as a string in the format “file:line”

Trait Implementations§

Source§

impl DerefMut for PooledRecord

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl Drop for PooledRecord

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Deref for PooledRecord

Source§

type Target = Record

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.