pub struct Record<'a> { /* private fields */ }Expand description
A log record containing message and source location metadata.
This struct is lifetime-bound to the message string to avoid
allocations during logging. The source location fields (module_path,
file, line) are captured at the call site using compiler intrinsics.
§Example
use reovim_kernel::api::v1::*;
let record = Record::builder(Level::Info)
.message("buffer opened")
.module_path("reovim_kernel::mm")
.file("buffer.rs")
.line(42)
.build();
assert_eq!(record.level(), Level::Info);
assert_eq!(record.message(), "buffer opened");
assert_eq!(record.line(), 42);Implementations§
Source§impl<'a> Record<'a>
impl<'a> Record<'a>
Sourcepub const fn builder(level: Level) -> RecordBuilder<'a>
pub const fn builder(level: Level) -> RecordBuilder<'a>
Creates a new record builder with the given level.
§Example
use reovim_kernel::api::v1::*;
let record = Record::builder(Level::Error)
.message("something went wrong")
.build();Sourcepub const fn module_path(&self) -> &'static str
pub const fn module_path(&self) -> &'static str
Returns the module path where the log was emitted.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Record<'a>
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> UnsafeUnpin for Record<'a>
impl<'a> UnwindSafe for Record<'a>
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