Struct DotPrinter

Source
pub struct DotPrinter<O: Write> {
    output: O,
    next_id: usize,
    settings: DotPrinterSettings,
}
Expand description

A visitor of the radix trie that will print the tree in “dot” notation.

See ‘DOT Language | Graphviz’ for information about syntax and example of the language.

Fields§

§output: O§next_id: usize§settings: DotPrinterSettings

Implementations§

Source§

impl<O: Write> DotPrinter<O>

Source

pub fn print<K, V, const PREFIX_LEN: usize, A: Allocator>( output: O, tree: &TreeMap<K, V, PREFIX_LEN, A>, settings: DotPrinterSettings, ) -> Option<Result<()>>
where K: Display, V: Display,

Write the dot-format of the given tree to the given output.

Source

pub(crate) unsafe fn print_tree<K, V, const PREFIX_LEN: usize>( output: O, tree: &OpaqueNodePtr<K, V, PREFIX_LEN>, settings: DotPrinterSettings, ) -> Result<()>
where K: Display, V: Display,

Write the dot-format of the given tree to the given output.

§Safety
  • For the duration of this function, the given node and all its children nodes must not get mutated.
Source

fn output_prelude(&mut self) -> Result<()>

Source

fn output_epilogue(&mut self) -> Result<()>

Source

fn get_id(&mut self) -> usize

Source

fn write_inner_node<K, T, N, const PREFIX_LEN: usize>( &mut self, inner_node: &N, ) -> Result<usize>
where K: Display, T: Display, N: InnerNode<PREFIX_LEN, Key = K, Value = T>,

Trait Implementations§

Source§

impl<K, T, O, const PREFIX_LEN: usize> Visitor<K, T, PREFIX_LEN> for DotPrinter<O>
where K: Display, T: Display, O: Write,

Source§

type Output = Result<usize, Error>

The type of value that the visitor produces.
Source§

fn default_output(&self) -> Self::Output

Produce the default value of the Self::Output type.
Source§

fn combine_output(&self, _: Self::Output, _: Self::Output) -> Self::Output

Combine two instances of the Self::Output type for this Visitor.
Source§

fn visit_node4(&mut self, t: &InnerNode4<K, T, PREFIX_LEN>) -> Self::Output

Visit a InnerNode4.
Source§

fn visit_node16(&mut self, t: &InnerNode16<K, T, PREFIX_LEN>) -> Self::Output

Visit a InnerNode16.
Source§

fn visit_node48(&mut self, t: &InnerNode48<K, T, PREFIX_LEN>) -> Self::Output

Visit a InnerNode48.
Source§

fn visit_node256(&mut self, t: &InnerNode256<K, T, PREFIX_LEN>) -> Self::Output

Visit a InnerNode256.
Source§

fn visit_leaf(&mut self, t: &LeafNode<K, T, PREFIX_LEN>) -> Self::Output

Visit a LeafNode.

Auto Trait Implementations§

§

impl<O> Freeze for DotPrinter<O>
where O: Freeze,

§

impl<O> RefUnwindSafe for DotPrinter<O>
where O: RefUnwindSafe,

§

impl<O> Send for DotPrinter<O>
where O: Send,

§

impl<O> Sync for DotPrinter<O>
where O: Sync,

§

impl<O> Unpin for DotPrinter<O>
where O: Unpin,

§

impl<O> UnwindSafe for DotPrinter<O>
where O: UnwindSafe,

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.