pub struct Account { /* private fields */ }Expand description
Canonical ICRC account atom.
Implementations§
Source§impl Account
impl Account
Sourcepub fn new<P: Into<Principal>, S: Into<Subaccount>>(
owner: P,
subaccount: Option<S>,
) -> Self
pub fn new<P: Into<Principal>, S: Into<Subaccount>>( owner: P, subaccount: Option<S>, ) -> Self
Construct from convertible owner and optional subaccount values.
Sourcepub const fn from_owner_and_subaccount(
owner: Principal,
subaccount: Option<Subaccount>,
) -> Self
pub const fn from_owner_and_subaccount( owner: Principal, subaccount: Option<Subaccount>, ) -> Self
Construct from canonical components.
Sourcepub const fn subaccount(&self) -> Option<Subaccount>
pub const fn subaccount(&self) -> Option<Subaccount>
Return the optional subaccount.
Sourcepub fn to_icrc_type(self) -> LedgerAccount
pub fn to_icrc_type(self) -> LedgerAccount
Convert to the upstream ICRC account type.
Trait Implementations§
Source§impl CandidType for Account
impl CandidType for Account
impl Copy for Account
Source§impl<'de> Deserialize<'de> for Account
impl<'de> Deserialize<'de> for Account
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
impl Eq for Account
Source§impl From<Account> for Account
impl From<Account> for Account
Source§fn from(value: LedgerAccount) -> Self
fn from(value: LedgerAccount) -> Self
Converts to this type from the input type.
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
Source§impl PartialOrd for Account
impl PartialOrd for Account
impl StructuralPartialEq for Account
Auto Trait Implementations§
impl Freeze 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