Trait ToDisplayTreeRef

Source
pub trait ToDisplayTreeRef<T: DisplayTree> {
    // Required method
    fn to_display_tree(&self) -> &T;
}
Expand description

A type that can be converted into a reference to a type that implements DisplayTree.

ToDisplayTreeRef is used to format fields in with a derived DisplayTree implementation annotated with #[tree]. For example, it is implemented for Box<impl DisplayTree> so that a boxed field can be formatted as a tree.

ToDisplayTreeRef should generally not implemented for any new types, unless you run into an edge case that is not covered by the implementations provided by display_tree.

Required Methods§

Source

fn to_display_tree(&self) -> &T

Converts this type into a type which implements DisplayTree.

to_display_tree() should not be called directly. It is used by display_tree_derive in the code emitted by [derive(DisplayTree)].

Implementations on Foreign Types§

Source§

impl<'a, T: DisplayTree + Clone> ToDisplayTreeRef<T> for Cow<'a, T>

Source§

impl<T: DisplayTree> ToDisplayTreeRef<T> for &T

Source§

impl<T: DisplayTree> ToDisplayTreeRef<T> for Box<T>

Source§

impl<T: DisplayTree> ToDisplayTreeRef<T> for Rc<T>

Source§

impl<T: DisplayTree> ToDisplayTreeRef<T> for Arc<T>

Implementors§