Skip to main content

LogNode

Struct LogNode 

Source
pub struct LogNode<'n, R> { /* private fields */ }

Implementations§

Source§

impl<'n, R> LogNode<'n, R>

Source

pub fn new(backend: &'n R) -> Self

Examples found in repository?
examples/x.rs (line 10)
8fn main() {
9    let r = PlainLogBackend;
10    let mut a = LogNode::new(&r);
11
12    let mut b = log_child!(a, "b");
13    log!(b, "1");
14    let mut c = b.child_shared("c");
15    log!(c, "2");
16    let mut d = b.child_shared("d");
17    log!(d, "3");
18    let mut e = log_child!(a, "e");
19    log!(e, "4");
20    let mut f = e.child_shared("f");
21    log!(f, "5");
22    log!(a, "6");
23
24    let g = log_child!(a, "g");
25    let h = g.child_shared("h");
26    let mut i = h.child_shared("i");
27    let mut j = log_child!(i, "j");
28    let mut k = log_child!(j, "k");
29    log!(k, "7");
30}
Source

pub fn child_shared<'a>( self: &'a LogNode<'n, R>, name: &'a str, ) -> LogNode<'a, R>

Examples found in repository?
examples/x.rs (line 14)
8fn main() {
9    let r = PlainLogBackend;
10    let mut a = LogNode::new(&r);
11
12    let mut b = log_child!(a, "b");
13    log!(b, "1");
14    let mut c = b.child_shared("c");
15    log!(c, "2");
16    let mut d = b.child_shared("d");
17    log!(d, "3");
18    let mut e = log_child!(a, "e");
19    log!(e, "4");
20    let mut f = e.child_shared("f");
21    log!(f, "5");
22    log!(a, "6");
23
24    let g = log_child!(a, "g");
25    let h = g.child_shared("h");
26    let mut i = h.child_shared("i");
27    let mut j = log_child!(i, "j");
28    let mut k = log_child!(j, "k");
29    log!(k, "7");
30}
Source§

impl<'n, R: LogBackend> LogNode<'n, R>

Source

pub fn put(&mut self, entry: Arguments<'_>)

Source

pub fn child<'a>( self: &'a mut LogNode<'n, R>, entry: Arguments<'_>, ) -> LogNode<'a, R>

Trait Implementations§

Source§

impl<'n, R: Debug> Debug for LogNode<'n, R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'n, R> Freeze for LogNode<'n, R>

§

impl<'n, R> RefUnwindSafe for LogNode<'n, R>
where R: RefUnwindSafe,

§

impl<'n, R> Send for LogNode<'n, R>
where R: Sync,

§

impl<'n, R> Sync for LogNode<'n, R>
where R: Sync,

§

impl<'n, R> Unpin for LogNode<'n, R>

§

impl<'n, R> UnsafeUnpin for LogNode<'n, R>

§

impl<'n, R> UnwindSafe for LogNode<'n, R>
where R: RefUnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.