pub struct DisplayAsGraph<'a, M: Marker> {
pub format: GraphFormat,
pub sharing: SharingLevel,
/* private fields */
}Expand description
Display a Simplicity expression as a graph in a chosen format.
Construct via Node::display_as_dot, Node::display_as_mermaid, or
DisplayAsGraph::new. The fmt::Display impl renders using the stored
format and sharing fields; to_dot_string
and to_mermaid_string always render in
the named format using the stored sharing level.
Fields§
§format: GraphFormatOutput format (DOT or Mermaid).
sharing: SharingLevelNode-sharing level used when rendering.
Implementations§
Source§impl<'a, M: Marker> DisplayAsGraph<'a, M>
impl<'a, M: Marker> DisplayAsGraph<'a, M>
Sourcepub fn new(
node: &'a Node<M>,
format: GraphFormat,
sharing: SharingLevel,
) -> Self
pub fn new( node: &'a Node<M>, format: GraphFormat, sharing: SharingLevel, ) -> Self
Create a new DisplayAsGraph with the given format and sharing level.
Sourcepub fn to_dot_string(&self) -> String
pub fn to_dot_string(&self) -> String
Render as a Graphviz DOT string using the stored sharing level.
Sourcepub fn to_mermaid_string(&self) -> String
pub fn to_mermaid_string(&self) -> String
Render as a Mermaid string using the stored sharing level.
Trait Implementations§
Auto Trait Implementations§
impl<'a, M> Freeze for DisplayAsGraph<'a, M>
impl<'a, M> !RefUnwindSafe for DisplayAsGraph<'a, M>
impl<'a, M> Send for DisplayAsGraph<'a, M>
impl<'a, M> Sync for DisplayAsGraph<'a, M>
impl<'a, M> Unpin for DisplayAsGraph<'a, M>
impl<'a, M> UnsafeUnpin for DisplayAsGraph<'a, M>
impl<'a, M> !UnwindSafe for DisplayAsGraph<'a, M>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more