pub struct Object {
pub data: ObjectData,
pub owner: Owner,
pub previous_transaction: Digest,
pub storage_rebate: u64,
}Expand description
An object on the IOTA blockchain
§BCS
The BCS serialized form for this type is defined by the following ABNF:
object = object-data owner digest u64Fields§
§data: ObjectDataThe meat of the object
owner: OwnerThe owner that unlocks this object
previous_transaction: DigestThe digest of the transaction that created or last mutated this object
storage_rebate: u64The amount of IOTA we would rebate if this object gets deleted. This number is re-calculated each time the object is mutated based on the present storage gas price.
Implementations§
Source§impl Object
impl Object
Sourcepub fn new(
data: ObjectData,
owner: Owner,
previous_transaction: Digest,
storage_rebate: u64,
) -> Self
pub fn new( data: ObjectData, owner: Owner, previous_transaction: Digest, storage_rebate: u64, ) -> Self
Build an object
Sourcepub fn object_ref(&self) -> ObjectReference
Available on crate features hash and serde only.
pub fn object_ref(&self) -> ObjectReference
hash and serde only.Return this object’s reference
Sourcepub fn object_type(&self) -> ObjectType
pub fn object_type(&self) -> ObjectType
Return this object’s type
Sourcepub fn as_struct_opt(&self) -> Option<&MoveStruct>
pub fn as_struct_opt(&self) -> Option<&MoveStruct>
Try to interpret this object as a move struct
Sourcepub fn as_struct(&self) -> &MoveStruct
pub fn as_struct(&self) -> &MoveStruct
Interpret this object as a move struct
Sourcepub fn as_package_opt(&self) -> Option<&MovePackage>
pub fn as_package_opt(&self) -> Option<&MovePackage>
Try to interpret this object as a move package
Sourcepub fn as_package(&self) -> &MovePackage
pub fn as_package(&self) -> &MovePackage
Interpret this object as a move package
Sourcepub fn data(&self) -> &ObjectData
pub fn data(&self) -> &ObjectData
Return this object’s data
Sourcepub fn previous_transaction(&self) -> Digest
pub fn previous_transaction(&self) -> Digest
Return the digest of the transaction that last modified this object
Sourcepub fn storage_rebate(&self) -> u64
pub fn storage_rebate(&self) -> u64
Return the storage rebate locked in this object
Storage rebates are credited to the gas coin used in a transaction that deletes this object.
pub fn to_rust<T: DeserializeOwned>(&self) -> Result<T>
serde only.Trait Implementations§
Source§impl Arbitrary for Object
impl Arbitrary for Object
Source§type Parameters = ()
type Parameters = ()
arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default.Source§type Strategy = BoxedStrategy<Object>
type Strategy = BoxedStrategy<Object>
Strategy used to generate values of type Self.Source§fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
Source§impl<'de> Deserialize<'de> for Object
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Object
serde only.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 Object
Available on crate feature serde only.
impl JsonSchema for Object
serde only.Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl TryFrom<Object> for NameRecord
Available on crate feature serde only.
impl TryFrom<Object> for NameRecord
serde only.Source§type Error = IotaNamesError
type Error = IotaNamesError
impl Eq for Object
impl StructuralPartialEq for Object
Auto Trait Implementations§
impl Freeze for Object
impl RefUnwindSafe for Object
impl Send for Object
impl Sync for Object
impl Unpin for Object
impl UnwindSafe for Object
Blanket Implementations§
Source§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