pub struct Diagram(/* private fields */);Expand description
A validated diagram that cannot represent an invalid state.
Invariants enforced:
- No duplicate node IDs across the entire diagram
- All edge
from/toreferences point to existing node IDs - No empty tiers (every tier has nodes or a container)
- Container nesting depth does not exceed the maximum
Construct via Diagram::try_from(raw_diagram).
Implementations§
Source§impl Diagram
impl Diagram
Sourcepub fn header(&self) -> &DiagramHeader
pub fn header(&self) -> &DiagramHeader
Returns the diagram header (title, subtitle, theme).
Sourcepub fn legend(&self) -> &[LegendEntry]
pub fn legend(&self) -> &[LegendEntry]
Returns the legend entries.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Diagram
impl<'de> Deserialize<'de> for Diagram
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl TryFrom<RawDiagram> for Diagram
impl TryFrom<RawDiagram> for Diagram
Source§type Error = ValidationError
type Error = ValidationError
The type returned in the event of a conversion error.
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