pub struct PatchOp {
pub op: Op,
pub entity: String,
pub entity_type: String,
pub from: Option<String>,
pub to: Option<String>,
pub content: Option<String>,
pub after: Option<String>,
pub separator: Option<String>,
pub fallback: bool,
}Fields§
§op: OpWhich of the op vocabulary’s actions this is.
entity: StringThe key the op is about: the entity’s name in the base, so a rename can still be located in a target that has not seen it yet.
entity_type: String§from: Option<String>§to: Option<String>§content: Option<String>The entity’s full new text. Absent for deleted.
after: Option<String>For added: the entity this one follows in the changed file. Absent
means “at the top of the file”. A missing anchor in the target is not an
error — the entity is appended, and the op is reported as placed by
fallback.
separator: Option<String>For added: the whitespace/comment gap that separated this entity from
its anchor, so an insertion does not weld two definitions together.
fallback: boolTrue on the whole-file escape hatch (entity == "(file)"): weave could
not express the change at entity granularity and is shipping the file.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PatchOp
impl<'de> Deserialize<'de> for PatchOp
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 PatchOp
Auto Trait Implementations§
impl Freeze for PatchOp
impl RefUnwindSafe for PatchOp
impl Send for PatchOp
impl Sync for PatchOp
impl Unpin for PatchOp
impl UnsafeUnpin for PatchOp
impl UnwindSafe for PatchOp
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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