Skip to main content

ObjectChange

Enum ObjectChange 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Created

A new object was created by this transaction.

Fields

§object_id: &'a Address
§output_version: Version
§output_digest: &'a Digest
§output_owner: &'a Owner
§

Mutated

An existing object’s contents (and possibly owner) were modified by this transaction.

Fields

§object_id: &'a Address
§input_version: Option<Version>

The object’s version before execution.

Always Some on V2 effects (read from ObjectIn::Exist). On V1 effects this is looked up in the effects’ modified_at_versions table, which may be absent for malformed effects; in that case it is None.

§input_digest: Option<&'a Digest>

The object’s digest before execution. None on V1 effects.

§input_owner: Option<&'a Owner>

The object’s owner before execution. None on V1 effects.

§output_version: Version
§output_digest: &'a Digest
§output_owner: &'a Owner
§

Unwrapped

A previously wrapped object was extracted (unwrapped) by this transaction and now appears at the root level of the object store.

Fields

§object_id: &'a Address
§output_version: Version
§output_digest: &'a Digest
§output_owner: &'a Owner
§

Deleted

An object was deleted by this transaction.

Fields

§object_id: &'a Address
§input_version: Option<Version>

The object’s version before deletion. See ObjectChange::Mutated for when this may be None.

§input_digest: Option<&'a Digest>
§input_owner: Option<&'a Owner>
§

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

§object_id: &'a Address
§input_version: Option<Version>

The object’s version before being wrapped. See ObjectChange::Mutated for when this may be None.

§input_digest: Option<&'a Digest>
§input_owner: Option<&'a Owner>
§

UnwrappedThenDeleted

An object was unwrapped and then deleted in the same transaction. Neither the prior nor the new state is recorded.

Fields

§object_id: &'a Address

Implementations§

Source§

impl<'a> ObjectChange<'a>

Source

pub fn object_id(&self) -> &'a Address

The id of the object affected by this change.

Trait Implementations§

Source§

impl<'a> Clone for ObjectChange<'a>

Source§

fn clone(&self) -> ObjectChange<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for ObjectChange<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> PartialEq for ObjectChange<'a>

Source§

fn eq(&self, other: &ObjectChange<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> Copy for ObjectChange<'a>

Source§

impl<'a> Eq for ObjectChange<'a>

Source§

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§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<U> As for U

§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts 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 more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V