Trait emerald_rs::storage::KeyfileStorage[][src]

pub trait KeyfileStorage: Send + Sync {
    fn put(&self, kf: &KeyFile) -> Result<(), KeystoreError>;
fn delete(&self, addr: &Address) -> Result<(), KeystoreError>;
fn hide(&self, addr: &Address) -> Result<bool, KeystoreError>;
fn unhide(&self, addr: &Address) -> Result<bool, KeystoreError>;
fn update(
        &self,
        addr: &Address,
        name: Option<String>,
        desc: Option<String>
    ) -> Result<(), KeystoreError>;
fn list_accounts(
        &self,
        show_hidden: bool
    ) -> Result<Vec<AccountInfo>, KeystoreError>;
fn search_by_address(
        &self,
        addr: &Address
    ) -> Result<(AccountInfo, KeyFile), KeystoreError>; fn is_addr_exist(&self, addr: &Address) -> Result<(), KeystoreError> { ... } }

Storage for KeyFiles

Required Methods

Put new KeyFile inside storage

Arguments:

  • kf - KeyFile to insert

Delete KeyFile from storage for specified Address

Arguments:

  • addr - target Address

Hide account for given address from being listed

Arguments:

  • addr - target Address

Unhide account for given address from being listed

Arguments:

  • addr - target Address

Update account for given address with new name and description

Arguments:

  • addr - target Address
  • name - optional new name
  • desc - optional new description

Lists info for Keystore files inside storage Can include hidden files if flag set.

Arguments

  • showHidden - flag to show hidden Keystore files

Return:

Array of AccountInfo struct

Search of KeyFile by specified Address Provides additional meta info for account

Arguments:

  • addr - target Address

Provided Methods

Check whether specified address is already inserted into the storage

Arguments

  • addr - address to check

Implementors