Skip to main content

IdentityGettersV0

Trait IdentityGettersV0 

Source
pub trait IdentityGettersV0 {
    // Required methods
    fn public_keys(&self) -> &BTreeMap<KeyID, IdentityPublicKey>;
    fn public_keys_mut(&mut self) -> &mut BTreeMap<KeyID, IdentityPublicKey>;
    fn public_keys_owned(self) -> BTreeMap<KeyID, IdentityPublicKey>;
    fn balance(&self) -> u64;
    fn revision(&self) -> Revision;
    fn id(&self) -> Identifier;
    fn get_public_key_by_id(&self, key_id: KeyID) -> Option<&IdentityPublicKey>;
    fn get_public_key_by_id_mut(
        &mut self,
        key_id: KeyID,
    ) -> Option<&mut IdentityPublicKey>;
    fn add_public_keys(
        &mut self,
        keys: impl IntoIterator<Item = IdentityPublicKey>,
    );
    fn get_public_key_max_id(&self) -> KeyID;
    fn get_first_public_key_matching(
        &self,
        purpose: Purpose,
        security_levels: HashSet<SecurityLevel>,
        key_types: HashSet<KeyType>,
        allow_disabled: bool,
    ) -> Option<&IdentityPublicKey>;
    fn add_public_key(&mut self, key: IdentityPublicKey);
}
Expand description

Trait for getters in Identity

Required Methods§

Source

fn public_keys(&self) -> &BTreeMap<KeyID, IdentityPublicKey>

Returns a reference to the public keys of the identity.

Source

fn public_keys_mut(&mut self) -> &mut BTreeMap<KeyID, IdentityPublicKey>

Returns a mutable reference to the public keys of the identity.

§Returns

A mutable reference to a BTreeMap containing the KeyID as keys and IdentityPublicKey as values.

Source

fn public_keys_owned(self) -> BTreeMap<KeyID, IdentityPublicKey>

Consumes the Identity and returns the owned public keys.

§Returns

A BTreeMap containing the KeyID as keys and IdentityPublicKey as values.

Source

fn balance(&self) -> u64

Returns the balance of the identity.

Source

fn revision(&self) -> Revision

Returns the revision of the identity.

Source

fn id(&self) -> Identifier

Returns the identifier of the identity.

Source

fn get_public_key_by_id(&self, key_id: KeyID) -> Option<&IdentityPublicKey>

Returns a public key for a given id

Source

fn get_public_key_by_id_mut( &mut self, key_id: KeyID, ) -> Option<&mut IdentityPublicKey>

Returns a public key for a given id

Source

fn add_public_keys(&mut self, keys: impl IntoIterator<Item = IdentityPublicKey>)

Add identity public keys

Source

fn get_public_key_max_id(&self) -> KeyID

Get the biggest public KeyID

Source

fn get_first_public_key_matching( &self, purpose: Purpose, security_levels: HashSet<SecurityLevel>, key_types: HashSet<KeyType>, allow_disabled: bool, ) -> Option<&IdentityPublicKey>

Get first public key matching a purpose, security levels or key types

Source

fn add_public_key(&mut self, key: IdentityPublicKey)

Add an identity public key

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§