pub enum Edit {
Text {
offset: usize,
length: usize,
replacement: String,
},
Replace {
path: Path,
value: Node,
},
RenameKey {
path: Path,
to: String,
},
Remove {
path: Path,
},
Insert {
path: Path,
value: Node,
},
Move {
from: Path,
to: Path,
},
}Expand description
One change to a document.
Variants§
Text
Replaces bytes of the text the document was read from; the reader’s fixes only.
Fields
Replace
Replaces the value at path.
RenameKey
Renames the key that ends path, keeping its value and place.
Remove
Removes the entry or item at path.
Insert
Adds value at path: a new key of an object, or an index of an array, the items from
it on moved one up.
Move
Moves the value at from to to, whose parent exists and which is not taken.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Edit
impl<'de> Deserialize<'de> for Edit
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 Edit
Auto Trait Implementations§
impl Forget for Edit
impl Freeze for Editwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Segment>: Freeze,
PhantomData<Node>: Freeze,
PhantomData<Entry>: Freeze,
impl Move for Edit
impl RefUnwindSafe for Edit
impl Send for Editwhere
RawVecInner: Send,
impl Sync for Editwhere
RawVecInner: Sync,
impl Unpin for Edit
impl UnsafeUnpin for Editwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Segment>: UnsafeUnpin,
PhantomData<Node>: UnsafeUnpin,
PhantomData<Entry>: UnsafeUnpin,
impl UnwindSafe for Editwhere
RawVecInner: 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