#[non_exhaustive]pub struct Change {
pub path: Arc<str>,
pub old_value: OwnedDataValue,
pub new_value: OwnedDataValue,
pub removed: bool,
pub replaced: bool,
/* private fields */
}Expand description
One write or removal, written as v3 wrote one.
A path that was absent before the write records old_value as null.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.path: Arc<str>The dotted path written.
old_value: OwnedDataValueWhat the path held before; null when it was absent.
new_value: OwnedDataValueThe value written; null for a removal (read
removed to tell a removal from a write of null).
removed: boolThe key at path was removed rather than written. Absent when
false, so a write’s JSON is v3’s.
replaced: boolThe write replaced the root at path instead of merging into it: a
host function’s write at a root replaces it, and map’s root
mapping, which records only the keys it wrote, merges. A trace’s
changes carry it, so a replay knows which; an audit entry’s are
always false, so the audit trail’s JSON is v3’s. Absent when
false.
Implementations§
Source§impl Change
impl Change
Sourcepub fn write(
path: impl Into<Arc<str>>,
old_value: OwnedDataValue,
new_value: OwnedDataValue,
) -> Self
pub fn write( path: impl Into<Arc<str>>, old_value: OwnedDataValue, new_value: OwnedDataValue, ) -> Self
A write of new_value over old_value at path.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Change
impl<'de> Deserialize<'de> for Change
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 Change
impl RefUnwindSafe for Change
impl Send for Change
impl Sync for Change
impl Unpin for Change
impl UnsafeUnpin for Change
impl UnwindSafe for Change
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