[][src]Trait lark_debug_with::DebugWith

pub trait DebugWith {
    fn fmt_with<Cx: ?Sized>(&self, cx: &Cx, fmt: &mut Formatter) -> Result;

    fn debug_with<Cx: ?Sized, 'me>(
        &'me self,
        cx: &'me Cx
    ) -> DebugCxPair<'me, &'me Self, Cx> { ... }
fn into_debug_with<Cx: ?Sized, 'me>(
        self,
        cx: &'me Cx
    ) -> DebugCxPair<'me, Self, Cx>
    where
        Self: Sized
, { ... } }

A Debug trait that carries a context. Most types in Lark implement it, and you can use derive(DebugWith) to get Debug-like behavior (from the lark-debug-derive crate).

To use it, do something like format!("{}", value.debug_with(cx)).

Required methods

fn fmt_with<Cx: ?Sized>(&self, cx: &Cx, fmt: &mut Formatter) -> Result

Loading content...

Provided methods

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized

Loading content...

Implementations on Foreign Types

impl<T> DebugWith for Vec<T> where
    T: DebugWith
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl DebugWith for ()
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl<A, B> DebugWith for (A, B) where
    A: DebugWith,
    B: DebugWith
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl<A, B, C> DebugWith for (A, B, C) where
    A: DebugWith,
    B: DebugWith,
    C: DebugWith
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl<A, B, C, D> DebugWith for (A, B, C, D) where
    A: DebugWith,
    B: DebugWith,
    C: DebugWith,
    D: DebugWith
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl<T: ?Sized, '_> DebugWith for &'_ T where
    T: DebugWith
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl<T: ?Sized, '_> DebugWith for &'_ mut T where
    T: DebugWith
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl<T> DebugWith for Option<T> where
    T: DebugWith
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl<O, E> DebugWith for Result<O, E> where
    O: DebugWith,
    E: DebugWith
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl<K, V, E> DebugWith for IndexMap<K, V, E> where
    K: DebugWith + Hash + Eq,
    V: DebugWith,
    E: BuildHasher
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl<T> DebugWith for Arc<T> where
    T: DebugWith
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl<T> DebugWith for Box<T> where
    T: DebugWith
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl<T> DebugWith for Rc<T> where
    T: DebugWith
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl DebugWith for !
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl<T> DebugWith for [T] where
    T: DebugWith
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl DebugWith for i8
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl DebugWith for i16
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl DebugWith for i32
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl DebugWith for i64
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl DebugWith for isize
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl DebugWith for u8
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl DebugWith for u16
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl DebugWith for u32
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl DebugWith for u64
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl DebugWith for usize
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl DebugWith for char
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl DebugWith for bool
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl DebugWith for String
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

impl DebugWith for str
[src]

fn debug_with<Cx: ?Sized, 'me>(
    &'me self,
    cx: &'me Cx
) -> DebugCxPair<'me, &'me Self, Cx>
[src]

fn into_debug_with<Cx: ?Sized, 'me>(
    self,
    cx: &'me Cx
) -> DebugCxPair<'me, Self, Cx> where
    Self: Sized
[src]

Loading content...

Implementors

Loading content...