[−][src]Struct log::MetadataBuilder
Builder for Metadata
.
Typically should only be used by log library creators or for testing and "shim loggers".
The MetadataBuilder
can set the different parameters of a Metadata
object, and returns
the created object when build
is called.
Example
ⓘThis code runs with edition 2018
let target = "myApp"; use log::{Level, MetadataBuilder}; let metadata = MetadataBuilder::new() .level(Level::Debug) .target(target) .build();
Implementations
impl<'a> MetadataBuilder<'a>
[src]
pub fn new() -> MetadataBuilder<'a>
[src]
Construct a new MetadataBuilder
.
The default options are:
level
:Level::Info
target
:""
pub fn level(&mut self, arg: Level) -> &mut MetadataBuilder<'a>
[src]
Setter for level
.
pub fn target(&mut self, target: &'a str) -> &mut MetadataBuilder<'a>
[src]
Setter for target
.
pub fn build(&self) -> Metadata<'a>
[src]
Returns a Metadata
object.
Trait Implementations
impl<'a> Debug for MetadataBuilder<'a>
[src]
impl<'a> Eq for MetadataBuilder<'a>
[src]
impl<'a> Hash for MetadataBuilder<'a>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a> Ord for MetadataBuilder<'a>
[src]
fn cmp(&self, other: &MetadataBuilder<'a>) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<'a> PartialEq<MetadataBuilder<'a>> for MetadataBuilder<'a>
[src]
fn eq(&self, other: &MetadataBuilder<'a>) -> bool
[src]
fn ne(&self, other: &MetadataBuilder<'a>) -> bool
[src]
impl<'a> PartialOrd<MetadataBuilder<'a>> for MetadataBuilder<'a>
[src]
fn partial_cmp(&self, other: &MetadataBuilder<'a>) -> Option<Ordering>
[src]
fn lt(&self, other: &MetadataBuilder<'a>) -> bool
[src]
fn le(&self, other: &MetadataBuilder<'a>) -> bool
[src]
fn gt(&self, other: &MetadataBuilder<'a>) -> bool
[src]
fn ge(&self, other: &MetadataBuilder<'a>) -> bool
[src]
impl<'a> StructuralEq for MetadataBuilder<'a>
[src]
impl<'a> StructuralPartialEq for MetadataBuilder<'a>
[src]
Auto Trait Implementations
impl<'a> Send for MetadataBuilder<'a>
impl<'a> Sync for MetadataBuilder<'a>
impl<'a> Unpin for MetadataBuilder<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,