Struct diem_sdk::types::account_config::AccountResource
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§
§impl AccountResource
impl AccountResource
pub fn new(
sequence_number: u64,
authentication_key: Vec<u8, Global>,
withdrawal_capability: Option<WithdrawCapabilityResource>,
key_rotation_capability: Option<KeyRotationCapabilityResource>,
sent_events: EventHandle,
received_events: EventHandle
) -> AccountResource
pub fn new( sequence_number: u64, authentication_key: Vec<u8, Global>, withdrawal_capability: Option<WithdrawCapabilityResource>, key_rotation_capability: Option<KeyRotationCapabilityResource>, sent_events: EventHandle, received_events: EventHandle ) -> AccountResource
Constructs an Account resource.
pub fn sequence_number(&self) -> u64
pub fn sequence_number(&self) -> u64
Return the sequence_number field for the given AccountResource
pub fn has_delegated_withdrawal_capability(&self) -> bool
pub fn has_delegated_withdrawal_capability(&self) -> bool
Returns if this account has delegated its withdrawal capability
pub 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
pub fn authentication_key(&self) -> &[u8] ⓘ
pub fn authentication_key(&self) -> &[u8] ⓘ
Return the authentication_key field for the given AccountResource
pub fn sent_events(&self) -> &EventHandle
pub fn sent_events(&self) -> &EventHandle
Return the sent_events handle for the given AccountResource
pub fn received_events(&self) -> &EventHandle
pub fn received_events(&self) -> &EventHandle
Return the received_events handle for the given AccountResource
Trait Implementations§
§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
.§fn arbitrary_with(
_top: <AccountResource as Arbitrary>::Parameters
) -> <AccountResource as Arbitrary>::Strategy
fn arbitrary_with( _top: <AccountResource as Arbitrary>::Parameters ) -> <AccountResource as Arbitrary>::Strategy
§impl Debug for AccountResource
impl Debug for AccountResource
§impl<'de> Deserialize<'de> for AccountResource
impl<'de> Deserialize<'de> for AccountResource
§fn deserialize<__D>(
__deserializer: __D
) -> Result<AccountResource, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<AccountResource, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl MoveResource for AccountResource
impl MoveResource for AccountResource
§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
§impl Serialize for AccountResource
impl Serialize for AccountResource
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl TryFrom<&AccountStateBlob> for AccountResource
impl TryFrom<&AccountStateBlob> for AccountResource
§fn try_from(
account_state_blob: &AccountStateBlob
) -> Result<AccountResource, Error>
fn try_from( account_state_blob: &AccountStateBlob ) -> Result<AccountResource, Error>
Performs the conversion.
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> TestOnlyHash for Twhere
T: Serialize + ?Sized,
impl<T> TestOnlyHash for Twhere T: Serialize + ?Sized,
§fn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.