Struct sui_sdk_types::types::unresolved::Input

source ·
pub struct Input {
    pub kind: Option<InputKind>,
    pub value: Option<Value>,
    pub object_id: Option<ObjectId>,
    pub version: Option<Version>,
    pub digest: Option<ObjectDigest>,
    pub mutable: Option<bool>,
}
Expand description

A potentially unresolved transaction input. Note that one can construct a fully resolved input using the provided constructors, but this struct is also useful when the input data is not complete.

If used in the context of transaction builder, make sure to call tx.resolve function on the transaction builder to resolve all unresolved inputs.

Fields§

§kind: Option<InputKind>§value: Option<Value>§object_id: Option<ObjectId>

Unique identifier for this object.

§version: Option<Version>

Either the initial_shared_version if object is a shared object, or the version if this is an owned object. The semantics of version can change depending on whether the object is shared or not. For shared objects, this is the initial version the object was shared at. For all other objects, this is the version of the object.

§digest: Option<ObjectDigest>

The digest of this object. This field is only relevant for owned/immutable/receiving inputs.

§mutable: Option<bool>

Whether this object is mutable. This field is only relevant for shared objects.

Implementations§

source§

impl Input

source

pub fn owned(object_id: ObjectId, version: u64, digest: ObjectDigest) -> Self

Return an owned kind of object with all required fields.

source

pub fn immutable( object_id: ObjectId, version: u64, digest: ObjectDigest, ) -> Self

Return an immutable kind of object with all required fields.

source

pub fn receiving( object_id: ObjectId, version: u64, digest: ObjectDigest, ) -> Self

Return a receiving kind of object with all required fields.

source

pub fn shared( object_id: ObjectId, initial_shared_version: u64, mutable: bool, ) -> Self

Return a shared object.

  • mutable controls whether a command can accept the object by value or mutable reference.
  • initial_shared_version is the first version the object was shared at.
source

pub fn by_id(object_id: ObjectId) -> Self

Return an object with only its unique identifier.

source

pub fn with_immutable_kind(&mut self)

Set the object kind to immutable.

source

pub fn with_owned_kind(&mut self)

Set the object kind to owned.

source

pub fn with_receiving_kind(&mut self)

Set the object kind to receiving.

source

pub fn with_shared_kind(&mut self)

Set the object kind to shared.

source

pub fn with_version(&mut self, version: u64)

Set the specified version.

source

pub fn with_digest(&mut self, digest: ObjectDigest)

Set the specified digest.

source

pub fn with_initial_shared_version(&mut self, initial: u64)

Set the initial shared version.

source

pub fn by_val(&mut self)

Make the object shared and set mutable to true when the input is used by value.

source

pub fn by_ref(&mut self)

Make the object shared and set mutable to false when the input is used by reference.

source

pub fn by_mut(&mut self)

Make the object shared and set mutable to true when the input is used by mutable reference.

Trait Implementations§

source§

impl Clone for Input

source§

fn clone(&self) -> Input

Returns a copy 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 Debug for Input

source§

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

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

impl Default for Input

source§

fn default() -> Input

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Input

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl JsonSchema for Input

source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
source§

fn json_schema(gen: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
source§

impl PartialEq for Input

source§

fn eq(&self, other: &Input) -> 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 Serialize for Input

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Input

source§

impl StructuralPartialEq for Input

Auto Trait Implementations§

§

impl Freeze for Input

§

impl RefUnwindSafe for Input

§

impl Send for Input

§

impl Sync for Input

§

impl Unpin for Input

§

impl UnwindSafe for Input

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, dst: *mut T)

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

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

source§

fn __clone_box(&self, _: Private) -> *mut ()

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> 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.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,