pub struct Diagram {
pub kind: DiagramKind,
pub input_arity: usize,
pub output_arity: usize,
}Expand description
Runtime string-diagram representation.
Fields§
§kind: DiagramKind§input_arity: usize§output_arity: usizeImplementations§
Source§impl Diagram
impl Diagram
pub fn identity(arity: usize) -> Diagram
pub fn box_( label: impl Into<String>, input_arity: usize, output_arity: usize, ) -> Diagram
pub fn swap(left: usize, right: usize) -> Diagram
Sourcepub fn cup(arity: usize) -> Diagram
pub fn cup(arity: usize) -> Diagram
Unit of a compact-closed duality, drawn as a cup: I -> A* ⊗ A.
Sourcepub fn cap(arity: usize) -> Diagram
pub fn cap(arity: usize) -> Diagram
Counit of a compact-closed duality, drawn as a cap: A ⊗ A* -> I.
pub fn then(self, next: Diagram) -> Diagram
pub fn parallel(self, other: Diagram) -> Diagram
pub fn normalize(&self) -> Diagram
pub fn normalize_with_trace(&self) -> NormalizationTrace
pub fn equivalent_to(&self, other: &Diagram) -> bool
pub fn render_text(&self) -> String
pub fn render_svg(&self) -> String
pub fn render_normalization_trace(&self) -> String
Trait Implementations§
impl Eq for Diagram
impl StructuralPartialEq for Diagram
Auto Trait Implementations§
impl Freeze for Diagram
impl RefUnwindSafe for Diagram
impl Send for Diagram
impl Sync for Diagram
impl Unpin for Diagram
impl UnsafeUnpin for Diagram
impl UnwindSafe for Diagram
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