pub enum PosEdit {
Insert {
pos: usize,
content: PosContent,
},
Delete {
from: usize,
to: usize,
},
Replace {
from: usize,
to: usize,
content: PosContent,
},
AddMark {
from: usize,
to: usize,
mark: Mark,
},
RemoveMark {
from: usize,
to: usize,
mark_type: String,
},
SetBlockAttrs {
pos: usize,
attrs: Map<String, Value>,
},
}Expand description
A single position-addressed edit. Offsets are flat ProseMirror positions.
Variants§
Insert
Insert content at pos.
Delete
Delete the flat range [from, to).
Replace
Replace the flat range [from, to) with content.
Fields
§
content: PosContentReplacement content.
AddMark
Add mark to text in the flat range [from, to).
Fields
RemoveMark
Remove every mark of mark_type from text in [from, to).
Fields
SetBlockAttrs
Replace the whole attribute map of the block at (or containing) pos.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PosEdit
impl<'de> Deserialize<'de> for PosEdit
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 PosEdit
Auto Trait Implementations§
impl Freeze for PosEdit
impl RefUnwindSafe for PosEdit
impl Send for PosEdit
impl Sync for PosEdit
impl Unpin for PosEdit
impl UnsafeUnpin for PosEdit
impl UnwindSafe for PosEdit
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