[−][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
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> Eq for MetadataBuilder<'a>
[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> 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> Ord for MetadataBuilder<'a>
[src]
fn cmp(&self, other: &MetadataBuilder<'a>) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[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> Debug for MetadataBuilder<'a>
[src]
Auto Trait Implementations
impl<'a> Send for MetadataBuilder<'a>
impl<'a> Unpin for MetadataBuilder<'a>
impl<'a> Sync for MetadataBuilder<'a>
impl<'a> UnwindSafe for MetadataBuilder<'a>
impl<'a> RefUnwindSafe for MetadataBuilder<'a>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,