Skip to main content

DisplayAsGraph

Struct DisplayAsGraph 

Source
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: GraphFormat

Output format (DOT or Mermaid).

§sharing: SharingLevel

Node-sharing level used when rendering.

Implementations§

Source§

impl<'a, M: Marker> DisplayAsGraph<'a, M>

Source

pub fn new( node: &'a Node<M>, format: GraphFormat, sharing: SharingLevel, ) -> Self

Create a new DisplayAsGraph with the given format and sharing level.

Source

pub fn to_dot_string(&self) -> String
where &'a Node<M>: DagLike,

Render as a Graphviz DOT string using the stored sharing level.

Source

pub fn to_mermaid_string(&self) -> String
where &'a Node<M>: DagLike,

Render as a Mermaid string using the stored sharing level.

Trait Implementations§

Source§

impl<'a, M: Marker> Display for DisplayAsGraph<'a, M>
where &'a Node<M>: DagLike,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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>
where <M as Marker>::CachedData: Sync + Send, <M as Marker>::Disconnect: Sync + Send, <M as Marker>::Witness: Sync + Send,

§

impl<'a, M> Sync for DisplayAsGraph<'a, M>
where <M as Marker>::CachedData: Sync + Send, <M as Marker>::Disconnect: Sync + Send, <M as Marker>::Witness: Sync + Send,

§

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,