pub enum Operation {
Edit {
block_id: BlockId,
path: String,
value: Value,
operator: EditOperator,
},
Move {
block_id: BlockId,
new_parent: BlockId,
index: Option<usize>,
},
MoveToTarget {
block_id: BlockId,
target: MoveTarget,
},
Append {
parent_id: BlockId,
content: Content,
label: Option<String>,
tags: Vec<String>,
semantic_role: Option<String>,
index: Option<usize>,
},
Delete {
block_id: BlockId,
cascade: bool,
preserve_children: bool,
},
Prune {
condition: Option<PruneCondition>,
},
Link {
source: BlockId,
edge_type: EdgeType,
target: BlockId,
metadata: Option<Value>,
},
Unlink {
source: BlockId,
edge_type: EdgeType,
target: BlockId,
},
CreateSnapshot {
name: String,
description: Option<String>,
},
RestoreSnapshot {
name: String,
},
WriteSection {
section_id: BlockId,
markdown: String,
base_heading_level: Option<usize>,
},
}Expand description
Operations that can be applied to a document
Variants§
Edit
Edit content at a path
Move
Move a block to a new parent (legacy)
MoveToTarget
Move a block with flexible target
Append
Append a new block
Fields
Delete
Delete a block
Prune
Prune unreachable blocks
Fields
§
condition: Option<PruneCondition>Link
Add an edge
Unlink
Remove an edge
CreateSnapshot
Create a snapshot
RestoreSnapshot
Restore a snapshot
WriteSection
Write markdown content to a section, replacing all children
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Operation
impl<'de> Deserialize<'de> for Operation
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 Operation
impl RefUnwindSafe for Operation
impl Send for Operation
impl Sync for Operation
impl Unpin for Operation
impl UnwindSafe for Operation
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