#[non_exhaustive]pub enum ObjectChange<'a> {
Created {
object_id: &'a Address,
output_version: Version,
output_digest: &'a Digest,
output_owner: &'a Owner,
},
Mutated {
object_id: &'a Address,
input_version: Option<Version>,
input_digest: Option<&'a Digest>,
input_owner: Option<&'a Owner>,
output_version: Version,
output_digest: &'a Digest,
output_owner: &'a Owner,
},
Unwrapped {
object_id: &'a Address,
output_version: Version,
output_digest: &'a Digest,
output_owner: &'a Owner,
},
Deleted {
object_id: &'a Address,
input_version: Option<Version>,
input_digest: Option<&'a Digest>,
input_owner: Option<&'a Owner>,
},
Wrapped {
object_id: &'a Address,
input_version: Option<Version>,
input_digest: Option<&'a Digest>,
input_owner: Option<&'a Owner>,
},
UnwrappedThenDeleted {
object_id: &'a Address,
},
}Expand description
A per-object change reported by a transaction’s effects.
This is a unified, classified view over both V1 and V2 effects. Each variant carries the fields that are meaningful for that kind of change.
Address, Digest, and Owner fields are borrowed from the underlying
effects rather than copied, so the enum is parameterised by the lifetime
of the borrowed TransactionEffects. Version (a u64) is returned
by value, since a reference to it would not be any smaller.
Fields that V1 effects do not store (input digests, input owners) are
modelled as Option, and are always None for V1-sourced changes.
The enum is #[non_exhaustive] because the Sui protocol may add new kinds
of object change in the future; pattern matches on it should include a
catch-all arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Created
A new object was created by this transaction.
Fields
Mutated
An existing object’s contents (and possibly owner) were modified by this transaction.
Fields
Unwrapped
A previously wrapped object was extracted (unwrapped) by this transaction and now appears at the root level of the object store.
Fields
Deleted
An object was deleted by this transaction.
Fields
input_version: Option<Version>The object’s version before deletion. See ObjectChange::Mutated
for when this may be None.
Wrapped
An object was wrapped inside another object by this transaction (and is therefore no longer at the root level of the object store).
Fields
input_version: Option<Version>The object’s version before being wrapped. See
ObjectChange::Mutated for when this may be None.
UnwrappedThenDeleted
An object was unwrapped and then deleted in the same transaction. Neither the prior nor the new state is recorded.
Implementations§
Trait Implementations§
Source§impl<'a> Clone for ObjectChange<'a>
impl<'a> Clone for ObjectChange<'a>
Source§fn clone(&self) -> ObjectChange<'a>
fn clone(&self) -> ObjectChange<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for ObjectChange<'a>
impl<'a> Debug for ObjectChange<'a>
Source§impl<'a> PartialEq for ObjectChange<'a>
impl<'a> PartialEq for ObjectChange<'a>
impl<'a> Copy for ObjectChange<'a>
impl<'a> Eq for ObjectChange<'a>
impl<'a> StructuralPartialEq for ObjectChange<'a>
Auto Trait Implementations§
impl<'a> Freeze for ObjectChange<'a>
impl<'a> RefUnwindSafe for ObjectChange<'a>
impl<'a> Send for ObjectChange<'a>
impl<'a> Sync for ObjectChange<'a>
impl<'a> Unpin for ObjectChange<'a>
impl<'a> UnsafeUnpin for ObjectChange<'a>
impl<'a> UnwindSafe for ObjectChange<'a>
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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