pub struct Account { /* private fields */ }Implementations§
Source§impl Account
impl Account
pub const STORED_SIZE: u32 = 62
Sourcepub fn new<P, S>(owner: P, subaccount: Option<S>) -> Account
pub fn new<P, S>(owner: P, subaccount: Option<S>) -> Account
Build an account from owner and optional subaccount.
Sourcepub const fn from_parts(
owner: Principal,
subaccount: Option<Subaccount>,
) -> Account
pub const fn from_parts( owner: Principal, subaccount: Option<Subaccount>, ) -> Account
Build an account from normalized runtime value parts.
Sourcepub const fn subaccount(&self) -> Option<Subaccount>
pub const fn subaccount(&self) -> Option<Subaccount>
Return the optional account subaccount.
Sourcepub fn to_icrc_type(self) -> Account
pub fn to_icrc_type(self) -> Account
Convert to the ICRC account representation.
Sourcepub fn dummy(v: u8) -> Account
pub fn dummy(v: u8) -> Account
Test helper that builds a deterministic account from a byte seed.
Sourcepub fn to_bytes(self) -> Result<Vec<u8>, AccountEncodeError>
pub fn to_bytes(self) -> Result<Vec<u8>, AccountEncodeError>
Convert the account into a deterministic, fixed-size byte representation.
Sourcepub fn max_storable() -> Account
pub fn max_storable() -> Account
Construct the maximum possible account for storage sizing tests.
pub fn try_from_bytes(bytes: &[u8]) -> Result<Account, &'static str>
Trait Implementations§
Source§impl CandidType for Account
impl CandidType 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
Source§impl EntityKeyBytes for Account
impl EntityKeyBytes for Account
Source§impl FieldValue for Account
impl FieldValue for Account
Source§impl Ord for Account
impl Ord for Account
Source§impl PartialOrd for Account
impl PartialOrd for Account
Source§impl SanitizeAuto for Account
impl SanitizeAuto for Account
fn sanitize_self(&mut self, _ctx: &mut dyn VisitorContext)
Source§impl SanitizeCustom for Account
impl SanitizeCustom for Account
fn sanitize_custom(&mut self, _ctx: &mut dyn VisitorContext)
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
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)
Source§impl Visitable for Account
impl Visitable for Account
fn drive(&self, _: &mut dyn VisitorCore)
fn drive_mut(&mut self, _: &mut dyn VisitorMutCore)
impl Atomic for Account
impl Copy for Account
impl Eq 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