Struct log::MetadataBuilder[][src]

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.

Example

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]

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
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.