pub enum GraphOp {
AddNode {
node: Node,
ports: Vec<Port>,
index: Option<usize>,
},
RemoveNode {
id: NodeId,
},
MoveNodes {
moves: Vec<(NodeId, Vec2)>,
},
ResizeNode {
id: NodeId,
size: Size2,
},
Reparent {
id: NodeId,
parent: Option<NodeId>,
pos: Vec2,
},
SetNodeLabel {
id: NodeId,
label: Arc<str>,
},
SetNodeData {
id: NodeId,
data: Value,
},
AddEdge {
edge: Edge,
},
RemoveEdge {
id: EdgeId,
},
SetEdge {
edge: Edge,
},
Batch(Vec<GraphOp>),
}Variants§
AddNode
index 为绘制顺序中的位置;None 表示置于最上层。
RemoveNode
节点必须已无连线、无子节点;需要级联时用 Graph::delete_ops。
MoveNodes
设置局部坐标(批量,拖拽一次提交一条)。
ResizeNode
Reparent
改父节点,pos 为新父节点下的局部坐标。
SetNodeLabel
SetNodeData
AddEdge
RemoveEdge
SetEdge
替换同 ID 边的属性(形状、标签、端点)。
Batch(Vec<GraphOp>)
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GraphOp
impl<'de> Deserialize<'de> for GraphOp
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
impl StructuralPartialEq for GraphOp
Auto Trait Implementations§
impl Forget for GraphOp
impl Freeze for GraphOpwhere
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<PortId>: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
PhantomData<Port>: Freeze,
PhantomData<(NodeId, Vec2)>: Freeze,
PhantomData<GraphOp>: Freeze,
impl Move for GraphOp
impl RefUnwindSafe for GraphOp
impl Send for GraphOp
impl Sync for GraphOp
impl Unpin for GraphOp
impl UnsafeUnpin for GraphOpwhere
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<PortId>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
PhantomData<Port>: UnsafeUnpin,
PhantomData<(NodeId, Vec2)>: UnsafeUnpin,
PhantomData<GraphOp>: UnsafeUnpin,
impl UnwindSafe for GraphOpwhere
Arc<str>: UnwindSafe,
RawVecInner: UnwindSafe,
BTreeMap<String, Value>: UnwindSafe,
BoxRaw<PortType>: UnwindSafe,
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