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§
Sourcefn to_display_tree(&self) -> &T
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)
].