pub struct AccountSpec {
pub ledger_id: Did,
pub owner: Did,
pub unit: UnitId,
pub purpose: Purpose,
pub flags: AccountFlags,
}Expand description
Everything needed to open (or idempotently re-open) an account.
Fields§
§ledger_id: DidThe cell ledger this account lives in.
owner: DidThe owning principal (a pseudonymous DID; may be a group owner DID).
unit: UnitIdThe unit (names its issuer).
purpose: PurposeWhat the account is for.
flags: AccountFlagsFlags; use AccountFlags::for_purpose for the sensible default.
Implementations§
Source§impl AccountSpec
impl AccountSpec
Sourcepub fn new(ledger_id: Did, owner: Did, unit: UnitId, purpose: Purpose) -> Self
pub fn new(ledger_id: Did, owner: Did, unit: UnitId, purpose: Purpose) -> Self
Convenience constructor deriving default flags from the purpose.
Sourcepub fn account_id(&self) -> Result<AccountId, LedgerError>
pub fn account_id(&self) -> Result<AccountId, LedgerError>
The derived id for this spec (see AccountId::derive).
Trait Implementations§
Source§impl Clone for AccountSpec
impl Clone for AccountSpec
Source§fn clone(&self) -> AccountSpec
fn clone(&self) -> AccountSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AccountSpec
impl Debug for AccountSpec
Source§impl<'de> Deserialize<'de> for AccountSpec
impl<'de> Deserialize<'de> for AccountSpec
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
Source§impl PartialEq for AccountSpec
impl PartialEq for AccountSpec
Source§fn eq(&self, other: &AccountSpec) -> bool
fn eq(&self, other: &AccountSpec) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for AccountSpec
impl Serialize for AccountSpec
impl Eq for AccountSpec
impl StructuralPartialEq for AccountSpec
Auto Trait Implementations§
impl Freeze for AccountSpec
impl RefUnwindSafe for AccountSpec
impl Send for AccountSpec
impl Sync for AccountSpec
impl Unpin for AccountSpec
impl UnsafeUnpin for AccountSpec
impl UnwindSafe for AccountSpec
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