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
impl Input
sourcepub fn owned(object_id: ObjectId, version: u64, digest: ObjectDigest) -> Self
pub fn owned(object_id: ObjectId, version: u64, digest: ObjectDigest) -> Self
Return an owned kind of object with all required fields.
sourcepub fn immutable(
object_id: ObjectId,
version: u64,
digest: ObjectDigest,
) -> Self
pub fn immutable( object_id: ObjectId, version: u64, digest: ObjectDigest, ) -> Self
Return an immutable kind of object with all required fields.
sourcepub fn receiving(
object_id: ObjectId,
version: u64,
digest: ObjectDigest,
) -> Self
pub fn receiving( object_id: ObjectId, version: u64, digest: ObjectDigest, ) -> Self
Return a receiving kind of object with all required fields.
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.
sourcepub fn with_immutable_kind(&mut self)
pub fn with_immutable_kind(&mut self)
Set the object kind to immutable.
sourcepub fn with_owned_kind(&mut self)
pub fn with_owned_kind(&mut self)
Set the object kind to owned.
sourcepub fn with_receiving_kind(&mut self)
pub fn with_receiving_kind(&mut self)
Set the object kind to receiving.
Set the object kind to shared.
sourcepub fn with_version(&mut self, version: u64)
pub fn with_version(&mut self, version: u64)
Set the specified version.
sourcepub fn with_digest(&mut self, digest: ObjectDigest)
pub fn with_digest(&mut self, digest: ObjectDigest)
Set the specified digest.
Set the initial shared version.
sourcepub fn by_val(&mut self)
pub fn by_val(&mut self)
Make the object shared and set mutable
to true when the input is used by value.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Input
impl<'de> Deserialize<'de> for Input
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>,
source§impl JsonSchema for Input
impl JsonSchema for Input
source§fn schema_name() -> String
fn schema_name() -> String
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moreimpl Eq for Input
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§
§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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)