Struct witchcraft_log::RecordBuilder
source · [−]pub struct RecordBuilder<'a>(_);
Expand description
A builder for Record
values.
Implementations
sourceimpl<'a> RecordBuilder<'a>
impl<'a> RecordBuilder<'a>
sourcepub fn new() -> RecordBuilder<'a>
pub fn new() -> RecordBuilder<'a>
Creates a RecordBuilder
initialized to default values.
sourcepub fn level(&mut self, level: Level) -> &mut RecordBuilder<'a>
pub fn level(&mut self, level: Level) -> &mut RecordBuilder<'a>
Sets the record’s verbosity level.
Defaults to Info
.
sourcepub fn target(&mut self, target: &'a str) -> &mut RecordBuilder<'a>
pub fn target(&mut self, target: &'a str) -> &mut RecordBuilder<'a>
Sets the record’s target.
Defaults to ""
.
sourcepub fn file(&mut self, file: Option<&'a str>) -> &mut RecordBuilder<'a>
pub fn file(&mut self, file: Option<&'a str>) -> &mut RecordBuilder<'a>
Sets the record’s source file.
Defaults to None
.
sourcepub fn line(&mut self, line: Option<u32>) -> &mut RecordBuilder<'a>
pub fn line(&mut self, line: Option<u32>) -> &mut RecordBuilder<'a>
Sets the record’s line.
Defaults to None
.
sourcepub fn message(&mut self, message: &'static str) -> &mut RecordBuilder<'a>
pub fn message(&mut self, message: &'static str) -> &mut RecordBuilder<'a>
Sets the record’s message.
Defaults to ""
.
sourcepub fn safe_params(
&mut self,
safe_params: &'a [(&'static str, &dyn Serialize)]
) -> &mut RecordBuilder<'a>
pub fn safe_params(
&mut self,
safe_params: &'a [(&'static str, &dyn Serialize)]
) -> &mut RecordBuilder<'a>
Sets the record’s safe parameters.
Defaults to []
.
sourcepub fn unsafe_params(
&mut self,
unsafe_params: &'a [(&'static str, &dyn Serialize)]
) -> &mut RecordBuilder<'a>
pub fn unsafe_params(
&mut self,
unsafe_params: &'a [(&'static str, &dyn Serialize)]
) -> &mut RecordBuilder<'a>
Sets the record’s unsafe parameters.
sourcepub fn error(&mut self, error: Option<&'a Error>) -> &mut RecordBuilder<'a>
pub fn error(&mut self, error: Option<&'a Error>) -> &mut RecordBuilder<'a>
Sets the record’s error.
Defaults to None
.
Trait Implementations
sourceimpl<'a> Default for RecordBuilder<'a>
impl<'a> Default for RecordBuilder<'a>
sourcefn default() -> RecordBuilder<'a>
fn default() -> RecordBuilder<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations
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> !UnwindSafe for RecordBuilder<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more