pub struct AccountId { /* private fields */ }
Expand description
Unique identifier for an account. On each chain this is unique.
Implementations§
Source§impl AccountId
impl AccountId
pub fn new( seq: AccountSequence, trace: AccountTrace, ) -> Result<Self, AbstractError>
pub fn local(seq: AccountSequence) -> Self
pub fn remote( seq: AccountSequence, trace: Vec<TruncatedChainId>, ) -> Result<Self, AbstractError>
Sourcepub fn into_remote_account_id(
self,
client_chain: TruncatedChainId,
host_chain: TruncatedChainId,
) -> Self
pub fn into_remote_account_id( self, client_chain: TruncatedChainId, host_chain: TruncatedChainId, ) -> Self
Construct the AccountId
for an account on a host chain based on the current Account.
Will pop the trace if the host chain is the last chain in the trace.
Sourcepub const fn const_new(seq: AccountSequence, trace: AccountTrace) -> Self
pub const fn const_new(seq: AccountSequence, trace: AccountTrace) -> Self
Does not verify input. Used internally for testing
pub fn seq(&self) -> AccountSequence
pub fn trace(&self) -> &AccountTrace
pub fn trace_mut(&mut self) -> &mut AccountTrace
pub fn is_local(&self) -> bool
pub fn is_remote(&self) -> bool
Sourcepub fn push_chain(&mut self, chain: TruncatedChainId)
pub fn push_chain(&mut self, chain: TruncatedChainId)
Push the chain to the account trace
pub fn decompose(self) -> (AccountTrace, AccountSequence)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AccountId
impl<'de> Deserialize<'de> for AccountId
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 JsonSchema for AccountId
impl JsonSchema for AccountId
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreSource§impl KeyDeserialize for &AccountId
impl KeyDeserialize for &AccountId
Source§const KEY_ELEMS: u16 = 7u16
const KEY_ELEMS: u16 = 7u16
The number of key elements is used for the deserialization of compound keys.
It should be equal to PrimaryKey::key().len()
type Output = AccountId
fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>
fn from_slice(value: &[u8]) -> Result<Self::Output, StdError>
Source§impl KeyDeserialize for AccountId
impl KeyDeserialize for AccountId
Source§const KEY_ELEMS: u16 = 7u16
const KEY_ELEMS: u16 = 7u16
The number of key elements is used for the deserialization of compound keys.
It should be equal to PrimaryKey::key().len()
type Output = AccountId
fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>
fn from_slice(value: &[u8]) -> Result<Self::Output, StdError>
Source§impl PrimaryKey<'_> for AccountId
impl PrimaryKey<'_> for AccountId
Source§type Prefix = AccountTrace
type Prefix = AccountTrace
These associated types need to implement
Prefixer
, so that they can be useful arguments
for prefix()
, sub_prefix()
, and their key-deserializable variants.type SubPrefix = ()
Source§type Suffix = u32
type Suffix = u32
These associated types need to implement
KeyDeserialize
, so that they can be returned from
range_de()
and friends.type SuperSuffix = AccountId
fn joined_key(&self) -> Vec<u8>
fn joined_extra_key(&self, key: &[u8]) -> Vec<u8>
impl StructuralPartialEq for AccountId
Auto Trait Implementations§
impl Freeze for AccountId
impl RefUnwindSafe for AccountId
impl Send for AccountId
impl Sync for AccountId
impl Unpin for AccountId
impl UnwindSafe for AccountId
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