Struct diem_types::account_config::resources::account::AccountResource
source · pub struct AccountResource { /* private fields */ }
Expand description
A Rust representation of an Account resource. This is not how the Account is represented in the VM but it’s a convenient representation.
Implementations§
source§impl AccountResource
impl AccountResource
sourcepub fn new(
sequence_number: u64,
authentication_key: Vec<u8>,
withdrawal_capability: Option<WithdrawCapabilityResource>,
key_rotation_capability: Option<KeyRotationCapabilityResource>,
sent_events: EventHandle,
received_events: EventHandle
) -> Self
pub fn new( sequence_number: u64, authentication_key: Vec<u8>, withdrawal_capability: Option<WithdrawCapabilityResource>, key_rotation_capability: Option<KeyRotationCapabilityResource>, sent_events: EventHandle, received_events: EventHandle ) -> Self
Constructs an Account resource.
sourcepub fn sequence_number(&self) -> u64
pub fn sequence_number(&self) -> u64
Return the sequence_number field for the given AccountResource
sourcepub fn has_delegated_withdrawal_capability(&self) -> bool
pub fn has_delegated_withdrawal_capability(&self) -> bool
Returns if this account has delegated its withdrawal capability
sourcepub fn has_delegated_key_rotation_capability(&self) -> bool
pub fn has_delegated_key_rotation_capability(&self) -> bool
Returns if this account has delegated its key rotation capability
sourcepub fn authentication_key(&self) -> &[u8] ⓘ
pub fn authentication_key(&self) -> &[u8] ⓘ
Return the authentication_key field for the given AccountResource
sourcepub fn sent_events(&self) -> &EventHandle
pub fn sent_events(&self) -> &EventHandle
Return the sent_events handle for the given AccountResource
sourcepub fn received_events(&self) -> &EventHandle
pub fn received_events(&self) -> &EventHandle
Return the received_events handle for the given AccountResource
Trait Implementations§
source§impl Arbitrary for AccountResource
impl Arbitrary for AccountResource
§type Parameters = (<Vec<u8, Global> as Arbitrary>::Parameters, <Option<WithdrawCapabilityResource> as Arbitrary>::Parameters, <Option<KeyRotationCapabilityResource> as Arbitrary>::Parameters, <EventHandle as Arbitrary>::Parameters, <EventHandle as Arbitrary>::Parameters, <u64 as Arbitrary>::Parameters)
type Parameters = (<Vec<u8, Global> as Arbitrary>::Parameters, <Option<WithdrawCapabilityResource> as Arbitrary>::Parameters, <Option<KeyRotationCapabilityResource> as Arbitrary>::Parameters, <EventHandle as Arbitrary>::Parameters, <EventHandle as Arbitrary>::Parameters, <u64 as Arbitrary>::Parameters)
The type of parameters that
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§type Strategy = Map<(<Vec<u8, Global> as Arbitrary>::Strategy, <Option<WithdrawCapabilityResource> as Arbitrary>::Strategy, <Option<KeyRotationCapabilityResource> as Arbitrary>::Strategy, <EventHandle as Arbitrary>::Strategy, <EventHandle as Arbitrary>::Strategy, <u64 as Arbitrary>::Strategy), fn(_: (Vec<u8, Global>, Option<WithdrawCapabilityResource>, Option<KeyRotationCapabilityResource>, EventHandle, EventHandle, u64)) -> AccountResource>
type Strategy = Map<(<Vec<u8, Global> as Arbitrary>::Strategy, <Option<WithdrawCapabilityResource> as Arbitrary>::Strategy, <Option<KeyRotationCapabilityResource> as Arbitrary>::Strategy, <EventHandle as Arbitrary>::Strategy, <EventHandle as Arbitrary>::Strategy, <u64 as Arbitrary>::Strategy), fn(_: (Vec<u8, Global>, Option<WithdrawCapabilityResource>, Option<KeyRotationCapabilityResource>, EventHandle, EventHandle, u64)) -> AccountResource>
The type of
Strategy
used to generate values of type Self
.source§fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
source§impl Debug for AccountResource
impl Debug for AccountResource
source§impl<'de> Deserialize<'de> for AccountResource
impl<'de> Deserialize<'de> for AccountResource
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 MoveResource for AccountResource
impl MoveResource for AccountResource
source§impl MoveStructType for AccountResource
impl MoveStructType for AccountResource
const MODULE_NAME: &'static IdentStr = ACCOUNT_MODULE_IDENTIFIER
const STRUCT_NAME: &'static IdentStr = ACCOUNT_MODULE_IDENTIFIER
fn module_identifier() -> Identifier
fn struct_identifier() -> Identifier
fn type_params() -> Vec<TypeTag, Global> ⓘ
fn struct_tag() -> StructTag
source§impl Serialize for AccountResource
impl Serialize for AccountResource
source§impl TryFrom<&AccountStateBlob> for AccountResource
impl TryFrom<&AccountStateBlob> for AccountResource
Auto Trait Implementations§
impl RefUnwindSafe for AccountResource
impl Send for AccountResource
impl Sync for AccountResource
impl Unpin for AccountResource
impl UnwindSafe for AccountResource
Blanket Implementations§
source§impl<T> TestOnlyHash for Twhere
T: Serialize + ?Sized,
impl<T> TestOnlyHash for Twhere T: Serialize + ?Sized,
source§fn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.