[][src]Struct log::MetadataBuilder

pub struct MetadataBuilder<'a> { /* fields omitted */ }

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.


This code runs with edition 2018
let target = "myApp";
use log::{Level, MetadataBuilder};
let metadata = MetadataBuilder::new()


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]

impl<'a> Ord for MetadataBuilder<'a>[src]

impl<'a> PartialEq<MetadataBuilder<'a>> for MetadataBuilder<'a>[src]

impl<'a> PartialOrd<MetadataBuilder<'a>> for MetadataBuilder<'a>[src]

impl<'a> StructuralEq for MetadataBuilder<'a>[src]

impl<'a> StructuralPartialEq for MetadataBuilder<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for MetadataBuilder<'a>

impl<'a> Send for MetadataBuilder<'a>

impl<'a> Sync for MetadataBuilder<'a>

impl<'a> Unpin for MetadataBuilder<'a>

impl<'a> UnwindSafe for MetadataBuilder<'a>

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.