pub struct UpdateOp { /* private fields */ }Expand description
Patches one record with a stage-time preimage of exactly the touched fields.
Patch and preimage must target the same substrate and have identical field
presence; both construction and deserialization enforce this invariant.
See crates/khive-changeset/docs/api/update.md for nullable-field semantics.
Implementations§
Source§impl UpdateOp
impl UpdateOp
Sourcepub fn new(
target_id: Id128,
patch: UpdatePatch,
preimage: UpdatePreimage,
) -> Result<Self, String>
pub fn new( target_id: Id128, patch: UpdatePatch, preimage: UpdatePreimage, ) -> Result<Self, String>
Constructs an update after validating patch/preimage congruence.
§Errors
Returns an error for differing substrates or field sets, or for an invalid captured salience, decay factor, or edge weight.
Sourcepub fn patch(&self) -> &UpdatePatch
pub fn patch(&self) -> &UpdatePatch
The staged patch.
Sourcepub fn preimage(&self) -> &UpdatePreimage
pub fn preimage(&self) -> &UpdatePreimage
The field-scoped prior value the patch touches.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for UpdateOp
impl<'de> Deserialize<'de> for UpdateOp
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 UpdateOp
Auto Trait Implementations§
impl Freeze for UpdateOp
impl RefUnwindSafe for UpdateOp
impl Send for UpdateOp
impl Sync for UpdateOp
impl Unpin for UpdateOp
impl UnsafeUnpin for UpdateOp
impl UnwindSafe for UpdateOp
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