pub enum ObjectData {
Struct(MoveStruct),
Package(MovePackage),
}Expand description
Object data, either a package or struct
§BCS
The BCS serialized form for this type is defined by the following ABNF:
object-data = object-data-struct / object-data-package
object-data-struct = %d00 object-move-struct
object-data-package = %d01 object-move-packageVariants§
Struct(MoveStruct)
An object whose governing logic lives in a published Move module
Package(MovePackage)
Map from each module name to raw serialized Move module bytes
Implementations§
Source§impl ObjectData
impl ObjectData
Sourcepub fn as_struct(&self) -> &MoveStruct
pub fn as_struct(&self) -> &MoveStruct
Converts this into a struct if it is a struct variant, or panics otherwise.
Sourcepub fn as_mut_struct(&mut self) -> &mut MoveStruct
pub fn as_mut_struct(&mut self) -> &mut MoveStruct
Converts this into a mut struct if it is a struct variant, or panics otherwise.
Sourcepub fn as_opt_struct(&self) -> Option<&MoveStruct>
pub fn as_opt_struct(&self) -> Option<&MoveStruct>
Converts this into a struct if it is a struct variant, or returns None otherwise.
Sourcepub fn as_opt_mut_struct(&mut self) -> Option<&mut MoveStruct>
pub fn as_opt_mut_struct(&mut self) -> Option<&mut MoveStruct>
Converts this into a mut struct if it is a struct variant, or returns None otherwise.
Sourcepub fn into_opt_struct(self) -> Option<MoveStruct>
pub fn into_opt_struct(self) -> Option<MoveStruct>
Converts this into a struct if it is a struct variant, or returns None otherwise.
Sourcepub fn into_struct(self) -> MoveStruct
pub fn into_struct(self) -> MoveStruct
Converts this into a struct if it is a struct variant, or panics otherwise.
Sourcepub fn is_package(&self) -> bool
pub fn is_package(&self) -> bool
Checks if this is a package variant.
Sourcepub fn as_package(&self) -> &MovePackage
pub fn as_package(&self) -> &MovePackage
Converts this into a package if it is a package variant, or panics otherwise.
Sourcepub fn as_mut_package(&mut self) -> &mut MovePackage
pub fn as_mut_package(&mut self) -> &mut MovePackage
Converts this into a mut package if it is a package variant, or panics otherwise.
Sourcepub fn as_opt_package(&self) -> Option<&MovePackage>
pub fn as_opt_package(&self) -> Option<&MovePackage>
Converts this into a package if it is a package variant, or returns None otherwise.
Sourcepub fn as_opt_mut_package(&mut self) -> Option<&mut MovePackage>
pub fn as_opt_mut_package(&mut self) -> Option<&mut MovePackage>
Converts this into a mut package if it is a package variant, or returns None otherwise.
Sourcepub fn into_opt_package(self) -> Option<MovePackage>
pub fn into_opt_package(self) -> Option<MovePackage>
Converts this into a package if it is a package variant, or returns None otherwise.
Sourcepub fn into_package(self) -> MovePackage
pub fn into_package(self) -> MovePackage
Converts this into a package if it is a package variant, or panics otherwise.
pub fn opt_object_type(&self) -> Option<&MoveObjectType>
pub fn opt_struct_tag(&self) -> Option<StructTag>
pub fn id(&self) -> ObjectId
Trait Implementations§
Source§impl Arbitrary for ObjectData
Available on crate feature proptest only.
impl Arbitrary for ObjectData
proptest only.Source§type Parameters = ()
type Parameters = ()
arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default.Source§type Strategy = BoxedStrategy<ObjectData>
type Strategy = BoxedStrategy<ObjectData>
Strategy used to generate values of type Self.Source§fn arbitrary_with(
args_shared: <Self as Arbitrary>::Parameters,
) -> Self::Strategy
fn arbitrary_with( args_shared: <Self as Arbitrary>::Parameters, ) -> Self::Strategy
Source§impl Clone for ObjectData
impl Clone for ObjectData
Source§fn clone(&self) -> ObjectData
fn clone(&self) -> ObjectData
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ObjectData
impl Debug for ObjectData
Source§impl<'de> Deserialize<'de> for ObjectData
Available on crate feature serde only.
impl<'de> Deserialize<'de> for ObjectData
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 Display for ObjectData
impl Display for ObjectData
impl Eq for ObjectData
Source§impl Hash for ObjectData
impl Hash for ObjectData
Source§impl PartialEq for ObjectData
impl PartialEq for ObjectData
Source§impl Serialize for ObjectData
Available on crate feature serde only.
impl Serialize for ObjectData
serde only.