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

Example

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

Methods

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> Ord for MetadataBuilder<'a>[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

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

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

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

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

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

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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.

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

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

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