pub struct Account { /* private fields */ }Expand description
IcyDB account atom with representation-preserving identity.
An absent subaccount and an explicit zero subaccount remain distinct database
identities. Explicit conversions to and from ic_platform::Account preserve
those fields; Platform compares both representations as the same ICRC account.
Each type retains its own binary serialization contract. Platform owns the
shared ICRC account text format; database equality remains local.
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.
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<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 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 StructuralPartialEq for Account
Source§impl Wire for Accountwhere
Self: Serialize,
Available on non-target_family=wasm only.
impl Wire for Accountwhere
Self: Serialize,
Available on non-
target_family=wasm only.Source§fn native_schema(
__ic_wire_schema: &mut SchemaContext,
) -> Result<Value, GenerationError>
fn native_schema( __ic_wire_schema: &mut SchemaContext, ) -> Result<Value, GenerationError>
Describe the serialized shape using the existing registry metadata grammar.
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