pub struct VisualLayout {
pub nodes: Vec<VisualNode>,
pub edges: Vec<VisualEdge>,
pub viewport: Option<Viewport>,
}Expand description
Visual layout for a state machine graph
Stores the visual representation of a state machine including node positions, edge routing, and visual metadata. This format is compatible with React Flow.
Fields§
§nodes: Vec<VisualNode>Visual nodes representing states
edges: Vec<VisualEdge>Visual edges representing transitions
viewport: Option<Viewport>Optional viewport information (zoom, pan)
Implementations§
Source§impl VisualLayout
impl VisualLayout
Sourcepub fn add_node(self, node: VisualNode) -> Self
pub fn add_node(self, node: VisualNode) -> Self
Add a visual node
Sourcepub fn add_edge(self, edge: VisualEdge) -> Self
pub fn add_edge(self, edge: VisualEdge) -> Self
Add a visual edge
Sourcepub fn with_viewport(self, viewport: Viewport) -> Self
pub fn with_viewport(self, viewport: Viewport) -> Self
Set viewport
Sourcepub fn to_react_flow_json(&self) -> Value
pub fn to_react_flow_json(&self) -> Value
Convert to React Flow format (JSON)
Returns a JSON object compatible with React Flow’s node/edge format.
Sourcepub fn from_react_flow_json(value: &Value) -> Result<Self, Error>
pub fn from_react_flow_json(value: &Value) -> Result<Self, Error>
Create from React Flow format (JSON)
Parses a React Flow JSON object into a VisualLayout.
Trait Implementations§
Source§impl Clone for VisualLayout
impl Clone for VisualLayout
Source§fn clone(&self) -> VisualLayout
fn clone(&self) -> VisualLayout
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VisualLayout
impl Debug for VisualLayout
Source§impl Default for VisualLayout
impl Default for VisualLayout
Source§impl<'de> Deserialize<'de> for VisualLayout
impl<'de> Deserialize<'de> for VisualLayout
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
Auto Trait Implementations§
impl Freeze for VisualLayout
impl RefUnwindSafe for VisualLayout
impl Send for VisualLayout
impl Sync for VisualLayout
impl Unpin for VisualLayout
impl UnsafeUnpin for VisualLayout
impl UnwindSafe for VisualLayout
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