Skip to main content

RecordBuilder

Struct RecordBuilder 

Source
pub struct RecordBuilder<'a> { /* private fields */ }
Expand description

Builder for constructing log records.

Use Record::builder to create an instance.

§Example

use reovim_kernel::api::v1::*;

let record = Record::builder(Level::Debug)
    .message("entering function")
    .module_path("reovim_kernel::core")
    .file("motion.rs")
    .line(100)
    .build();

Implementations§

Source§

impl<'a> RecordBuilder<'a>

Source

pub const fn message(self, message: &'a str) -> Self

Sets the log message.

Source

pub const fn module_path(self, module_path: &'static str) -> Self

Sets the module path.

Source

pub const fn file(self, file: &'static str) -> Self

Sets the file name.

Source

pub const fn line(self, line: u32) -> Self

Sets the line number.

Source

pub const fn build(self) -> Record<'a>

Builds the record.

Trait Implementations§

Source§

impl<'a> Debug for RecordBuilder<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for RecordBuilder<'a>

§

impl<'a> RefUnwindSafe for RecordBuilder<'a>

§

impl<'a> Send for RecordBuilder<'a>

§

impl<'a> Sync for RecordBuilder<'a>

§

impl<'a> Unpin for RecordBuilder<'a>

§

impl<'a> UnsafeUnpin for RecordBuilder<'a>

§

impl<'a> UnwindSafe for RecordBuilder<'a>

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<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.