pub enum Patch {
UpdateAttr {
path: Vec<String>,
id: NodeId,
old: Attrs,
new: Attrs,
},
AddNode {
path: Vec<String>,
parent_id: NodeId,
nodes: Vec<Node>,
},
AddMark {
path: Vec<String>,
node_id: NodeId,
marks: Vec<Mark>,
},
RemoveMark {
path: Vec<String>,
parent_id: NodeId,
marks: Vec<Mark>,
},
RemoveNode {
path: Vec<String>,
parent_id: NodeId,
nodes: Vec<Node>,
},
MoveNode {
path: Vec<String>,
node_id: NodeId,
source_parent_id: NodeId,
target_parent_id: NodeId,
position: Option<usize>,
},
SortChildren {
path: Vec<String>,
parent_id: NodeId,
old_children: Vec<NodeId>,
new_children: Vec<NodeId>,
},
}
Expand description
文档补丁枚举 用于描述对文档树的各种修改操作
Variants§
UpdateAttr
更新节点属性
AddNode
添加新节点
AddMark
添加标记
RemoveMark
移除标记
RemoveNode
移除节点
MoveNode
移动节点
Fields
SortChildren
排序子节点
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Patch
impl<'de> Deserialize<'de> for Patch
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 Patch
impl RefUnwindSafe for Patch
impl Send for Patch
impl Sync for Patch
impl Unpin for Patch
impl UnwindSafe for Patch
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more