[−][src]Struct deviz::Tree
A builder for tree output. Construct using deviz::tree or
deviz::text_tree.
Examples
let mut tree = deviz::tree("ast"); tree.begin_node(); tree.label("+"); { tree.begin_node(); tree.label("1"); tree.end_node(); } { tree.begin_node(); tree.label("2"); tree.end_node(); } tree.end_node();
Implementations
impl Tree[src]
pub fn begin_node(&mut self)[src]
Begin a new subtree, i.e. a node and all its children.
A call to this function should be paired with a call to end_node.
Between these two calls, the node and its children should be built.
pub fn end_node(&mut self)[src]
pub fn label(&mut self, label: impl Into<String>)[src]
Add a label for the current node. By default, a node has no label.
Panics
This method should be called between a call to begin_node and a call
to end_node. Panics otherwise.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Tree[src]
impl Send for Tree[src]
impl Sync for Tree[src]
impl Unpin for Tree[src]
impl UnwindSafe for Tree[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
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.
pub 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>,