pub struct Account { /* private fields */ }Expand description
Canonical ICRC account atom for database identity.
An absent and an explicit all-zero subaccount denote the same account and are stored as absence. Constructors, deserialization and Platform conversion share that normalization; nonzero subaccounts retain all 32 bytes. Platform owns the shared account text grammar.
Implementations§
Source§impl Account
impl Account
Sourcepub fn new<P, S>(owner: P, subaccount: Option<S>) -> Account
pub fn new<P, S>(owner: P, subaccount: Option<S>) -> Account
Construct from convertible owner and optional subaccount values.
Sourcepub const fn from_owner_and_subaccount(
owner: Principal,
subaccount: Option<Subaccount>,
) -> Account
pub const fn from_owner_and_subaccount( owner: Principal, subaccount: Option<Subaccount>, ) -> Account
Construct from canonical components.
Sourcepub const fn subaccount(&self) -> Option<Subaccount>
pub const fn subaccount(&self) -> Option<Subaccount>
Return the optional subaccount.
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 NormalizeAuto for Account
impl NormalizeAuto for Account
fn normalize_self(&mut self, _ctx: &mut dyn VisitorContext)
Source§impl NormalizeCustom for Account
impl NormalizeCustom for Account
fn normalize_custom(&mut self, _ctx: &mut dyn VisitorContext)
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
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
impl StructuralPartialEq for Account
Source§impl ValidateAuto for Account
impl ValidateAuto for Account
fn validate_self(&self, _ctx: &mut dyn VisitorContext)
Source§impl ValidateCustom for Account
impl ValidateCustom for Account
fn validate_custom(&self, _ctx: &mut dyn VisitorContext)
Auto Trait Implementations§
impl Forget for Account
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> Normalize for Twhere
T: NormalizeAuto + NormalizeCustom,
Source§impl<T> NormalizeAndValidate for Twhere
T: Visitable,
impl<T> NormalizeAndValidate for Twhere
T: Visitable,
Source§fn normalize_and_validate(self) -> Result<Self, VisitorError>
fn normalize_and_validate(self) -> Result<Self, VisitorError>
Normalize and then validate this application-owned value. Read more