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
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>
&self,
addr: &Address,
name: Option<String>,
desc: Option<String>
) -> Result<(), KeystoreError>
Update account for given address with new name and description
Arguments:
- addr - target
Address
- name - optional new name
- desc - optional new description
fn list_accounts(
&self,
show_hidden: bool
) -> Result<Vec<AccountInfo>, KeystoreError>
&self,
show_hidden: bool
) -> Result<Vec<AccountInfo>, KeystoreError>
Lists info for Keystore
files inside storage
Can include hidden files if flag set.
Arguments
showHidden
- flag to show hiddenKeystore
files
Return:
Array of AccountInfo
struct
fn search_by_address(
&self,
addr: &Address
) -> Result<(AccountInfo, KeyFile), KeystoreError>
&self,
addr: &Address
) -> Result<(AccountInfo, KeyFile), KeystoreError>
Search of KeyFile
by specified Address
Provides additional meta info for account
Arguments:
- addr - target
Address
Provided Methods
fn is_addr_exist(&self, addr: &Address) -> Result<(), KeystoreError>
Check whether specified address is already inserted into the storage
Arguments
addr
- address to check