fn open_storage(&self, id: &str, config: Option<&str>, credentials: Option<&str>) -> Result<Box<PostgresStorage>, WalletStorageError> {
        let config = config
            .map(serde_json::from_str::<PostgresConfig>)
            .map_or(Ok(None), |v| v.map(Some))
            .map_err(|err| CommonError::InvalidStructure(format!("Cannot deserialize config: {:?}", err)))?;
        let credentials = credentials
            .map(serde_json::from_str::<PostgresCredentials>)
            .map_or(Ok(None), |v| v.map(Some))
            .map_err(|err| CommonError::InvalidStructure(format!("Cannot deserialize credentials: {:?}", err)))?;

        let config = match config
        {
            Some(config) => config,
            None => return Err(WalletStorageError::ConfigError)
        };
        let credentials = match credentials {
            Some(credentials) => credentials,
            None => return Err(WalletStorageError::ConfigError)
        };

        // initialize using the global selected_strategy object
        let r1 = SELECTED_STRATEGY.read().unwrap();
        r1.as_ref().open_wallet(id, &config, &credentials)
    }
///
/// Establishes a connection to the SQLite DB with the provided id located in the path
/// specified in the config. In case of a successful onection returns a Storage object
/// embedding the connection and the encryption keys that will be used for encryption and
/// decryption operations.
///
///
/// # Arguments
///
///  * `id` - id of the SQLite DB file
///  * `config` - config containing the location of SQLite DB files
///  * `credentials` - DB credentials
///
/// # Returns
///
/// Result that can be either:
///
///  * `(Box<Storage>, Vec<u8>)` - Tuple of `SQLiteStorage` and `encryption keys`
///  * `WalletStorageError`
///
/// # Errors
///
/// Any of the following `WalletStorageError` type_ of errors can be throw by this method:
///
///  * `WalletStorageError::NotFound` - File with the provided id not found
///  * `IOError("IO error during storage operation:...")` - Failed connection or SQL query
///
Establishes a connection to the SQLite DB with the provided id located in the path
specified in the config. In case of a successful onection returns a Storage object
embedding the connection and the encryption keys that will be used for encryption and
decryption operations.
Establishes a connection to the SQLite DB with the provided id located in the path specified in the config . In case of a successful onection returns a Storage object embedding the connection and the encryption keys that will be used for encryption and decryption operations .
fn open_storage(&self, id: &str, config: Option<&str>, credentials: Option<&str>) -> Result<Box<PostgresStorage>, WalletStorageError> {
        let config = config
            .map(serde_json::from_str::<PostgresConfig>)
            .map_or(Ok(None), |v| v.map(Some))
            .map_err(|err| CommonError::InvalidStructure(format!("Cannot deserialize config: {:?}", err)))?;
        let credentials = credentials
            .map(serde_json::from_str::<PostgresCredentials>)
            .map_or(Ok(None), |v| v.map(Some))
            .map_err(|err| CommonError::InvalidStructure(format!("Cannot deserialize credentials: {:?}", err)))?;
        let config = match config
        {
            Some(config) => config,
            None => return Err(WalletStorageError::ConfigError)
        };
        let credentials = match credentials {
            Some(credentials) => credentials,
            None => return Err(WalletStorageError::ConfigError)
        };
        // initialize using the global selected_strategy object
        let r1 = SELECTED_STRATEGY.read().unwrap();
        r1.as_ref().open_wallet(id, &config, &credentials)
    }
fn open_storage ( & self , id : & str , config : Option < & str > , credentials : Option < & str > ) -> Result < Box < PostgresStorage > , WalletStorageError > { let config = config . map ( serde_json :: from_str :: < PostgresConfig > ) . map_or ( Ok ( None ) , | v | v . map ( Some ) ) . map_err ( | err | CommonError :: InvalidStructure ( format ! ( " " err ) ) ) ? ; let credentials = credentials . map ( serde_json :: from_str :: < PostgresCredentials > ) . map_or ( Ok ( None ) , | v | v . map ( Some ) ) . map_err ( | err | CommonError :: InvalidStructure ( format ! ( " " err ) ) ) ? ; let config = match config { Some ( config ) => config , None => return Err ( WalletStorageError :: ConfigError ) } ; let credentials = match credentials { Some ( credentials ) => credentials , None => return Err ( WalletStorageError :: ConfigError ) } ; // initialize using the global selected_strategy object let r1 = SELECTED_STRATEGY . read ( ) . unwrap ( ) ; r1 . as_ref ( ) . open_wallet ( id , & config , & credentials ) }
Establishes a connection to the SQLite DB with the provided id located in the path
specified in the config.
Establishes a connection to the SQLite DB with the provided id located in the path specified in the config .
&self
id
&str
config
Option<&str>
credentials
Option<&str>
Result that can be either.

`(Box, Vec)` - Tuple of `SQLiteStorage` and `encryption keys`
`WalletStorageError`
Result that can be either . ` ( Box Vec ) ` - Tuple of ` SQLiteStorage ` and ` encryption keys ` ` WalletStorageError `
&self
id
&str
config
Option<&str>
credentials
Option<&str>
errors
Any of the following `WalletStorageError` type_ of errors can be throw by this method.

`WalletStorageError::NotFound` - File with the provided id not found
`IOError("IO error during storage operation:...")` - Failed connection or SQL query
Any of the following ` WalletStorageError ` type_ of errors can be throw by this method . ` WalletStorageError :: NotFound ` - File with the provided id not found ` IOError ( " IO error during storage operation : ... " ) ` - Failed connection or SQL query