Skip to main content

GraphOp

Enum GraphOp 

Source
pub enum GraphOp {
Show 61 variants AddNode { id: NodeId, node: Node, }, RemoveNode { id: NodeId, node: Node, ports: Vec<(PortId, Port)>, edges: Vec<(EdgeId, Edge)>, bindings: Vec<(BindingId, Binding)>, }, SetNodePos { id: NodeId, from: CanvasPoint, to: CanvasPoint, }, SetNodeOrigin { id: NodeId, from: Option<NodeOrigin>, to: Option<NodeOrigin>, }, SetNodeKind { id: NodeId, from: NodeKindKey, to: NodeKindKey, }, SetNodeKindVersion { id: NodeId, from: u32, to: u32, }, SetNodeSelectable { id: NodeId, from: Option<bool>, to: Option<bool>, }, SetNodeFocusable { id: NodeId, from: Option<bool>, to: Option<bool>, }, SetNodeDraggable { id: NodeId, from: Option<bool>, to: Option<bool>, }, SetNodeConnectable { id: NodeId, from: Option<bool>, to: Option<bool>, }, SetNodeDeletable { id: NodeId, from: Option<bool>, to: Option<bool>, }, SetNodeParent { id: NodeId, from: Option<GroupId>, to: Option<GroupId>, }, SetNodeExtent { id: NodeId, from: Option<NodeExtent>, to: Option<NodeExtent>, }, SetNodeExpandParent { id: NodeId, from: Option<bool>, to: Option<bool>, }, SetNodeSize { id: NodeId, from: Option<CanvasSize>, to: Option<CanvasSize>, }, SetNodeHidden { id: NodeId, from: bool, to: bool, }, SetNodeCollapsed { id: NodeId, from: bool, to: bool, }, SetNodePorts { id: NodeId, from: Vec<PortId>, to: Vec<PortId>, }, SetNodeData { id: NodeId, from: Value, to: Value, }, AddPort { id: PortId, port: Port, }, RemovePort { id: PortId, port: Port, edges: Vec<(EdgeId, Edge)>, bindings: Vec<(BindingId, Binding)>, }, SetPortConnectable { id: PortId, from: Option<bool>, to: Option<bool>, }, SetPortConnectableStart { id: PortId, from: Option<bool>, to: Option<bool>, }, SetPortConnectableEnd { id: PortId, from: Option<bool>, to: Option<bool>, }, SetPortType { id: PortId, from: Option<TypeDesc>, to: Option<TypeDesc>, }, SetPortData { id: PortId, from: Value, to: Value, }, AddEdge { id: EdgeId, edge: Edge, }, RemoveEdge { id: EdgeId, edge: Edge, bindings: Vec<(BindingId, Binding)>, }, SetEdgeKind { id: EdgeId, from: EdgeKind, to: EdgeKind, }, SetEdgeSelectable { id: EdgeId, from: Option<bool>, to: Option<bool>, }, SetEdgeFocusable { id: EdgeId, from: Option<bool>, to: Option<bool>, }, SetEdgeHidden { id: EdgeId, from: bool, to: bool, }, SetEdgeInteractionWidth { id: EdgeId, from: Option<f32>, to: Option<f32>, }, SetEdgeDeletable { id: EdgeId, from: Option<bool>, to: Option<bool>, }, SetEdgeReconnectable { id: EdgeId, from: Option<EdgeReconnectable>, to: Option<EdgeReconnectable>, }, SetEdgeEndpoints { id: EdgeId, from: EdgeEndpoints, to: EdgeEndpoints, }, AddImport { id: GraphId, import: GraphImport, }, RemoveImport { id: GraphId, import: GraphImport, }, SetImportAlias { id: GraphId, from: Option<String>, to: Option<String>, }, AddSymbol { id: SymbolId, symbol: Symbol, }, RemoveSymbol { id: SymbolId, symbol: Symbol, }, SetSymbolName { id: SymbolId, from: String, to: String, }, SetSymbolType { id: SymbolId, from: Option<TypeDesc>, to: Option<TypeDesc>, }, SetSymbolDefaultValue { id: SymbolId, from: Option<Value>, to: Option<Value>, }, SetSymbolMeta { id: SymbolId, from: Value, to: Value, }, AddGroup { id: GroupId, group: Group, }, RemoveGroup { id: GroupId, group: Group, detached: Vec<(NodeId, Option<GroupId>)>, bindings: Vec<(BindingId, Binding)>, }, SetGroupRect { id: GroupId, from: CanvasRect, to: CanvasRect, }, SetGroupTitle { id: GroupId, from: String, to: String, }, SetGroupColor { id: GroupId, from: Option<String>, to: Option<String>, }, AddStickyNote { id: StickyNoteId, note: StickyNote, }, RemoveStickyNote { id: StickyNoteId, note: StickyNote, bindings: Vec<(BindingId, Binding)>, }, SetStickyNoteText { id: StickyNoteId, from: String, to: String, }, SetStickyNoteRect { id: StickyNoteId, from: CanvasRect, to: CanvasRect, }, SetStickyNoteColor { id: StickyNoteId, from: Option<String>, to: Option<String>, }, AddBinding { id: BindingId, binding: Binding, }, RemoveBinding { id: BindingId, binding: Binding, }, SetBindingSubject { id: BindingId, from: BindingEndpoint, to: BindingEndpoint, }, SetBindingTarget { id: BindingId, from: BindingEndpoint, to: BindingEndpoint, }, SetBindingKind { id: BindingId, from: Option<String>, to: Option<String>, }, SetBindingMeta { id: BindingId, from: Value, to: Value, },
}
Expand description

A reversible edit operation.

Destructive variants carry the removed data so the operation can be inverted for undo/redo. Higher-level tools should batch multiple ops into a single transaction.

Variants§

§

AddNode

Adds a node.

Fields

§node: Node
§

RemoveNode

Removes a node.

This operation is expected to remove associated ports and edges as well.

Fields

§node: Node
§ports: Vec<(PortId, Port)>
§edges: Vec<(EdgeId, Edge)>
§bindings: Vec<(BindingId, Binding)>
§

SetNodePos

Sets a node position.

§

SetNodeOrigin

Sets a node origin override.

§

SetNodeKind

Sets a node kind identifier.

§

SetNodeKindVersion

Sets a node kind version (for per-kind migrations).

Fields

§from: u32
§to: u32
§

SetNodeSelectable

Sets a node selectable override.

Fields

§from: Option<bool>
§

SetNodeFocusable

Sets a node focusable override.

Fields

§from: Option<bool>
§

SetNodeDraggable

Sets a node draggable override.

Fields

§from: Option<bool>
§

SetNodeConnectable

Sets a node connectable override.

Fields

§from: Option<bool>
§

SetNodeDeletable

Sets a node deletable override.

Fields

§from: Option<bool>
§

SetNodeParent

Sets a node parent container (group frame).

§

SetNodeExtent

Sets a node extent override.

§

SetNodeExpandParent

Sets a node expand-parent override.

Fields

§from: Option<bool>
§

SetNodeSize

Sets a node explicit size.

§

SetNodeHidden

Sets a node hidden state.

Fields

§from: bool
§to: bool
§

SetNodeCollapsed

Sets a node collapsed state.

Fields

§from: bool
§to: bool
§

SetNodePorts

Sets a node’s port ordering.

Fields

§from: Vec<PortId>
§

SetNodeData

Sets a node’s domain-owned data payload.

This is the primary edit op for node parameters and is intentionally untyped at the model layer: typing and validation live in profiles/rules.

Fields

§from: Value
§

AddPort

Adds a port.

Fields

§port: Port
§

RemovePort

Removes a port.

This operation is expected to remove associated edges as well.

Fields

§port: Port
§edges: Vec<(EdgeId, Edge)>
§bindings: Vec<(BindingId, Binding)>
§

SetPortConnectable

Sets a port connectable override.

Fields

§from: Option<bool>
§

SetPortConnectableStart

Sets a port start-connectable override.

Fields

§from: Option<bool>
§

SetPortConnectableEnd

Sets a port end-connectable override.

Fields

§from: Option<bool>
§

SetPortType

Sets a port type descriptor.

§

SetPortData

Sets a port domain-owned data payload.

Fields

§from: Value
§

AddEdge

Adds an edge.

Fields

§edge: Edge
§

RemoveEdge

Removes an edge.

Fields

§edge: Edge
§bindings: Vec<(BindingId, Binding)>
§

SetEdgeKind

Sets an edge kind.

Fields

§

SetEdgeSelectable

Sets an edge selectable override.

Fields

§from: Option<bool>
§

SetEdgeFocusable

Sets an edge focusable override.

Fields

§from: Option<bool>
§

SetEdgeHidden

Sets an edge hidden flag.

Fields

§from: bool
§to: bool
§

SetEdgeInteractionWidth

Sets an edge hit-test interaction width override.

Fields

§from: Option<f32>
§

SetEdgeDeletable

Sets an edge deletable override.

Fields

§from: Option<bool>
§

SetEdgeReconnectable

Sets an edge reconnectable override.

§

SetEdgeEndpoints

Sets an edge’s endpoints (preserving edge identity for reconnection workflows).

§

AddImport

Adds a graph import reference.

Fields

§

RemoveImport

Removes a graph import reference.

Fields

§

SetImportAlias

Sets an import alias.

§

AddSymbol

Adds a symbol.

Fields

§symbol: Symbol
§

RemoveSymbol

Removes a symbol.

Fields

§symbol: Symbol
§

SetSymbolName

Sets a symbol name.

Fields

§from: String
§

SetSymbolType

Sets a symbol type descriptor.

§

SetSymbolDefaultValue

Sets a symbol default value.

Fields

§

SetSymbolMeta

Updates a symbol metadata payload (domain-owned).

Fields

§from: Value
§

AddGroup

Adds a group.

Fields

§group: Group
§

RemoveGroup

Removes a group.

This operation is expected to detach nodes that were parented to the group.

Fields

§group: Group
§detached: Vec<(NodeId, Option<GroupId>)>
§bindings: Vec<(BindingId, Binding)>
§

SetGroupRect

Sets a group’s bounds.

§

SetGroupTitle

Sets a group’s title.

Fields

§from: String
§

SetGroupColor

Sets a group color override.

§

AddStickyNote

Adds a sticky note.

§

RemoveStickyNote

Removes a sticky note.

Fields

§bindings: Vec<(BindingId, Binding)>
§

SetStickyNoteText

Sets a sticky note text body.

Fields

§from: String
§

SetStickyNoteRect

Sets a sticky note bounds.

§

SetStickyNoteColor

Sets a sticky note color override.

§

AddBinding

Adds a knowledge-canvas binding.

Fields

§binding: Binding
§

RemoveBinding

Removes a knowledge-canvas binding.

Fields

§binding: Binding
§

SetBindingSubject

Sets a binding subject endpoint.

§

SetBindingTarget

Sets a binding target endpoint.

§

SetBindingKind

Sets a binding relationship label.

§

SetBindingMeta

Updates a binding metadata payload (domain-owned).

Fields

§from: Value

Trait Implementations§

Source§

impl Clone for GraphOp

Source§

fn clone(&self) -> GraphOp

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GraphOp

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for GraphOp

Source§

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 Serialize for GraphOp

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.