pub struct Account {
pub owner: Principal,
pub subaccount: Option<Subaccount>,
}Expand description
Account
Fields§
§owner: Principal§subaccount: Option<Subaccount>Implementations§
Source§impl Account
impl Account
pub const STORABLE_MAX_SIZE: u32 = 62u32
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 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) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Convert the account into a deterministic IC-style byte representation.
Sourcepub fn max_storable() -> Account
pub fn max_storable() -> Account
Construct the maximum possible account for storage sizing tests.
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 Filterable for Account
impl Filterable for Account
type Filter = TextFilterKind
type ListFilter = TextListFilterKind
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)
fn sanitize_children(&mut self)
fn sanitize_self_with(&mut self, _ctx: &SanitizeContext)
fn sanitize_children_with(&mut self, _ctx: &SanitizeContext)
Source§impl SanitizeCustom for Account
impl SanitizeCustom for Account
fn sanitize_custom(&mut self)
fn sanitize_custom_with(&mut self, _ctx: &SanitizeContext)
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 Storable for Account
impl Storable for Account
Source§fn to_bytes(&self) -> Cow<'_, [u8]>
fn to_bytes(&self) -> Cow<'_, [u8]>
Converts the element into a possibly borrowed byte slice. Read more
Source§fn to_bytes_checked(&self) -> Cow<'_, [u8]>
fn to_bytes_checked(&self) -> Cow<'_, [u8]>
Like
to_bytes, but checks that bytes conform to declared bounds.Source§fn into_bytes_checked(self) -> Vec<u8> ⓘwhere
Self: Sized,
fn into_bytes_checked(self) -> Vec<u8> ⓘwhere
Self: Sized,
Like
into_bytes, but checks that bytes conform to declared bounds.Source§fn check_bounds(bytes: &[u8])
fn check_bounds(bytes: &[u8])
Validates that a byte slice fits within this type’s declared bounds.
Source§impl UpdateView for Account
impl UpdateView for Account
type UpdateViewType = Account
Source§fn merge(&mut self, v: <Account as UpdateView>::UpdateViewType)
fn merge(&mut self, v: <Account as UpdateView>::UpdateViewType)
merge the updateview into self
Source§impl ValidateAuto for Account
impl ValidateAuto for Account
fn validate_self(&self) -> Result<(), ErrorTree>
fn validate_children(&self) -> Result<(), ErrorTree>
fn validate_self_with(&self, _ctx: &ValidateContext) -> Result<(), ErrorTree>
fn validate_children_with( &self, _ctx: &ValidateContext, ) -> Result<(), ErrorTree>
Source§impl ValidateCustom for Account
impl ValidateCustom for Account
fn validate_custom(&self) -> Result<(), ErrorTree>
fn validate_custom_with(&self, _ctx: &ValidateContext) -> Result<(), ErrorTree>
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 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