pub struct Input {
    pub kind: Option<InputKind>,
    pub value: Option<Value>,
    pub object_id: Option<Address>,
    pub version: Option<Version>,
    pub digest: Option<Digest>,
    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<Address>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<Digest>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: Address, version: u64, digest: Digest) -> Self
 
pub fn owned(object_id: Address, version: u64, digest: Digest) -> Self
Return an owned kind of object with all required fields.
Sourcepub fn immutable(object_id: Address, version: u64, digest: Digest) -> Self
 
pub fn immutable(object_id: Address, version: u64, digest: Digest) -> Self
Return an immutable kind of object with all required fields.
Sourcepub fn receiving(object_id: Address, version: u64, digest: Digest) -> Self
 
pub fn receiving(object_id: Address, version: u64, digest: Digest) -> Self
Return a receiving kind of object with all required fields.
Return a shared object.
- mutablecontrols whether a command can accept the object by value or mutable reference.
- initial_shared_versionis the first version the object was shared at.
Sourcepub fn with_immutable_kind(self) -> Self
 
pub fn with_immutable_kind(self) -> Self
Set the object kind to immutable.
Sourcepub fn with_owned_kind(self) -> Self
 
pub fn with_owned_kind(self) -> Self
Set the object kind to owned.
Sourcepub fn with_receiving_kind(self) -> Self
 
pub fn with_receiving_kind(self) -> Self
Set the object kind to receiving.
Set the object kind to shared.
Sourcepub fn with_version(self, version: u64) -> Self
 
pub fn with_version(self, version: u64) -> Self
Set the specified version.
Sourcepub fn with_digest(self, digest: Digest) -> Self
 
pub fn with_digest(self, digest: Digest) -> Self
Set the specified digest.
Set the initial shared version.
Sourcepub fn by_val(self) -> Self
 
pub fn by_val(self) -> 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<'a, T: Serialize> From<Serialized<'a, T>> for Input
 
impl<'a, T: Serialize> From<Serialized<'a, T>> for Input
Source§fn from(value: Serialized<'a, T>) -> Self
 
fn from(value: Serialized<'a, T>) -> Self
impl 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§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