pub struct Account {
pub owner: Principal,
pub subaccount: Option<[u8; 32]>,
}Expand description
A Principal owner and optional subaccount.
Absent and explicitly zero subaccounts compare and hash identically, while Serde preserves the distinction. Ordering compares owner, then effective subaccount bytes.
Fields§
§owner: PrincipalThe Principal that owns this account.
subaccount: Option<[u8; 32]>The explicit subaccount, or absence to select the effective zero value.
Implementations§
Source§impl Account
impl Account
Sourcepub const MAX_LENGTH_IN_TEXT: usize = 136
pub const MAX_LENGTH_IN_TEXT: usize = 136
The maximum admitted UTF-8 byte length of an Account text.
Sourcepub fn effective_subaccount(&self) -> &[u8; 32]
pub fn effective_subaccount(&self) -> &[u8; 32]
Borrows the explicit subaccount, or the effective zero value if absent.
Trait Implementations§
impl Copy for Account
Source§impl<'de> Deserialize<'de> for Account
impl<'de> Deserialize<'de> for Account
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Account, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Account, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Account
Source§impl From<Account> for IndexValue<'_>
impl From<Account> for IndexValue<'_>
Source§impl Ord for Account
impl Ord for Account
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Account
impl PartialOrd for Account
impl PrimaryKey for Account
Source§impl Serialize for Account
impl Serialize for Account
Source§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
Auto Trait Implementations§
impl Forget for Account
impl Freeze for Account
impl Move for Account
impl RefUnwindSafe for Account
impl Send for Account
impl Sync for Account
impl Unpin for Account
impl UnsafeUnpin for Account
impl UnwindSafe for Account
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