Struct emerald_rs::storage::DbStorage [−][src]
pub struct DbStorage { pub db: DB, }
Database backed storage for KeyFile
Fields
db: DB
Database handler
Methods
impl DbStorage
[src]
impl DbStorage
pub fn new<P: AsRef<Path>>(dir: P) -> Result<DbStorage, KeystoreError>
[src]
pub fn new<P: AsRef<Path>>(dir: P) -> Result<DbStorage, KeystoreError>
Create new database storage
Use specified directory as parent folder
Storage structure:
key - Address
value - <filename> + SEPARATOR + <keyfile_json>
Arguments:
- dir - parent folder
Trait Implementations
impl KeyfileStorage for DbStorage
[src]
impl KeyfileStorage for DbStorage
fn put(&self, kf: &KeyFile) -> Result<(), KeystoreError>
[src]
fn put(&self, kf: &KeyFile) -> Result<(), KeystoreError>
Put new KeyFile
inside storage Read more
fn delete(&self, addr: &Address) -> Result<(), KeystoreError>
[src]
fn delete(&self, addr: &Address) -> Result<(), KeystoreError>
Delete KeyFile
from storage for specified Address
Read more
fn search_by_address(
&self,
addr: &Address
) -> Result<(AccountInfo, KeyFile), KeystoreError>
[src]
fn search_by_address(
&self,
addr: &Address
) -> Result<(AccountInfo, KeyFile), KeystoreError>
Search of KeyFile
by specified Address
Provides additional meta info for account Read more
fn hide(&self, addr: &Address) -> Result<bool, KeystoreError>
[src]
fn hide(&self, addr: &Address) -> Result<bool, KeystoreError>
Hide account for given address from being listed Read more
fn unhide(&self, addr: &Address) -> Result<bool, KeystoreError>
[src]
fn unhide(&self, addr: &Address) -> Result<bool, KeystoreError>
Unhide account for given address from being listed Read more
fn list_accounts(
&self,
show_hidden: bool
) -> Result<Vec<AccountInfo>, KeystoreError>
[src]
fn list_accounts(
&self,
show_hidden: bool
) -> Result<Vec<AccountInfo>, KeystoreError>
Lists info for Keystore
files inside storage Can include hidden files if flag set. Read more
fn update(
&self,
addr: &Address,
name: Option<String>,
desc: Option<String>
) -> Result<(), KeystoreError>
[src]
fn update(
&self,
addr: &Address,
name: Option<String>,
desc: Option<String>
) -> Result<(), KeystoreError>
Update account for given address with new name and description Read more
fn is_addr_exist(&self, addr: &Address) -> Result<(), KeystoreError>
[src]
fn is_addr_exist(&self, addr: &Address) -> Result<(), KeystoreError>
Check whether specified address is already inserted into the storage Read more