pub struct Field<Name: MoveType, Value: MoveType> {
pub id: UID,
pub name: Name,
pub value: Value,
}
Expand description
Internal object used for storing the field and value
Fields§
§id: UID
Determined by the hash of the object ID, the field name value and it’s type, i.e. hash(parent.id || name || Name)
name: Name
The value for the name of this field
value: Value
The value bound to this field
Implementations§
Source§impl<Name: MoveType, Value: MoveType> Field<Name, Value>
impl<Name: MoveType, Value: MoveType> Field<Name, Value>
pub fn move_instance( self, name: <Name as MoveType>::TypeTag, value: <Value as MoveType>::TypeTag, ) -> MoveInstance<Self>
pub fn type_( name: <Name as MoveType>::TypeTag, value: <Value as MoveType>::TypeTag, ) -> FieldTypeTag<Name, Value>
Source§impl<K: MoveType, V: MoveType> Field<K, V>
impl<K: MoveType, V: MoveType> Field<K, V>
Sourcepub fn unpack_instance(
this: MoveInstance<Self>,
) -> (MoveInstance<K>, MoveInstance<V>)
pub fn unpack_instance( this: MoveInstance<Self>, ) -> (MoveInstance<K>, MoveInstance<V>)
Unpack an instance of a dynamic field into its name and value instances.
Trait Implementations§
Source§impl<'de, Name: MoveType, Value: MoveType> Deserialize<'de> for Field<Name, Value>
impl<'de, Name: MoveType, Value: MoveType> Deserialize<'de> for Field<Name, Value>
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<Name: MoveType, Value: MoveType> MoveStruct for Field<Name, Value>
impl<Name: MoveType, Value: MoveType> MoveStruct for Field<Name, Value>
type StructTag = FieldTypeTag<Name, Value>
Source§impl<Name: MoveType, Value: MoveType> MoveType for Field<Name, Value>
impl<Name: MoveType, Value: MoveType> MoveType for Field<Name, Value>
Source§impl<Name: PartialEq + MoveType, Value: PartialEq + MoveType> PartialEq for Field<Name, Value>
impl<Name: PartialEq + MoveType, Value: PartialEq + MoveType> PartialEq for Field<Name, Value>
Source§impl<Name: MoveType, Value: MoveType> StaticModule for Field<Name, Value>
impl<Name: MoveType, Value: MoveType> StaticModule for Field<Name, Value>
fn module() -> Identifier
Source§impl<Name: MoveType, Value: MoveType> StaticName for Field<Name, Value>
impl<Name: MoveType, Value: MoveType> StaticName for Field<Name, Value>
fn name() -> Identifier
Source§impl<Name: MoveType + StaticTypeTag, Value: MoveType + StaticTypeTag> StaticTypeParams for Field<Name, Value>
impl<Name: MoveType + StaticTypeTag, Value: MoveType + StaticTypeTag> StaticTypeParams for Field<Name, Value>
fn type_params() -> Vec<TypeTag>
impl<Name: Eq + MoveType, Value: Eq + MoveType> Eq for Field<Name, Value>
impl<Name: MoveType, Value: MoveType> StructuralPartialEq for Field<Name, Value>
Auto Trait Implementations§
impl<Name, Value> Freeze for Field<Name, Value>
impl<Name, Value> RefUnwindSafe for Field<Name, Value>where
Name: RefUnwindSafe,
Value: RefUnwindSafe,
impl<Name, Value> Send for Field<Name, Value>
impl<Name, Value> Sync for Field<Name, Value>
impl<Name, Value> Unpin for Field<Name, Value>
impl<Name, Value> UnwindSafe for Field<Name, Value>where
Name: UnwindSafe,
Value: UnwindSafe,
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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