pub struct Wallet {}
Implementations
sourceimpl Wallet
impl Wallet
sourcepub fn register_storage(
xtype: &str,
create: Option<WalletCreate>,
open: Option<WalletOpen>,
close: Option<WalletClose>,
delete: Option<WalletDelete>,
add_record: Option<WalletAddRecord>,
update_record_value: Option<WalletUpdateRecordValue>,
update_record_tags: Option<WalletUpdateRecordTags>,
add_record_tags: Option<WalletAddRecordTags>,
delete_record_tags: Option<WalletDeleteRecordTags>,
delete_record: Option<WalletDeleteRecord>,
get_record: Option<WalletGetRecord>,
get_record_id: Option<WalletGetRecordId>,
get_record_type: Option<WalletGetRecordType>,
get_record_value: Option<WalletGetRecordValue>,
get_record_tags: Option<WalletGetRecordTags>,
free_record: Option<WalletFreeRecord>,
get_storage_metadata: Option<WalletGetStorageMetadata>,
set_storage_metadata: Option<WalletSetStorageMetadata>,
free_storage_metadata: Option<WalletFreeStorageMetadata>,
search_records: Option<WalletSearchRecords>,
search_all_records: Option<WalletSearchAllRecords>,
get_search_total_count: Option<WalletGetSearchTotalCount>,
fetch_search_next_record: Option<WalletFetchSearchNextRecord>,
free_search: Option<WalletFreeSearch>
) -> Result<(), ErrorCode>
pub fn register_storage(
xtype: &str,
create: Option<WalletCreate>,
open: Option<WalletOpen>,
close: Option<WalletClose>,
delete: Option<WalletDelete>,
add_record: Option<WalletAddRecord>,
update_record_value: Option<WalletUpdateRecordValue>,
update_record_tags: Option<WalletUpdateRecordTags>,
add_record_tags: Option<WalletAddRecordTags>,
delete_record_tags: Option<WalletDeleteRecordTags>,
delete_record: Option<WalletDeleteRecord>,
get_record: Option<WalletGetRecord>,
get_record_id: Option<WalletGetRecordId>,
get_record_type: Option<WalletGetRecordType>,
get_record_value: Option<WalletGetRecordValue>,
get_record_tags: Option<WalletGetRecordTags>,
free_record: Option<WalletFreeRecord>,
get_storage_metadata: Option<WalletGetStorageMetadata>,
set_storage_metadata: Option<WalletSetStorageMetadata>,
free_storage_metadata: Option<WalletFreeStorageMetadata>,
search_records: Option<WalletSearchRecords>,
search_all_records: Option<WalletSearchAllRecords>,
get_search_total_count: Option<WalletGetSearchTotalCount>,
fetch_search_next_record: Option<WalletFetchSearchNextRecord>,
free_search: Option<WalletFreeSearch>
) -> Result<(), ErrorCode>
Registers custom wallet implementation.
It allows library user to provide custom wallet implementation.
Arguments
command_handle
- Command handle to map callback to caller context.xtype
- Wallet type name.create
- WalletType create operation handleropen
- WalletType open operation handlerset
- Wallet set operation handlerget
- Wallet get operation handlerget_not_expired
- Wallet get_not_expired operation handlerlist
- Wallet list operation handler(must to return data in the following format: {“values”:[{“key”:“”, “value”:“”}, {“key”:“”, “value”:“”}]}close
- Wallet close operation handlerdelete
- WalletType delete operation handlerfree
- Handler that allows to de-allocate strings allocated in caller code
sourcepub fn register_storage_timeout(
xtype: &str,
create: Option<WalletCreate>,
open: Option<WalletOpen>,
close: Option<WalletClose>,
delete: Option<WalletDelete>,
add_record: Option<WalletAddRecord>,
update_record_value: Option<WalletUpdateRecordValue>,
update_record_tags: Option<WalletUpdateRecordTags>,
add_record_tags: Option<WalletAddRecordTags>,
delete_record_tags: Option<WalletDeleteRecordTags>,
delete_record: Option<WalletDeleteRecord>,
get_record: Option<WalletGetRecord>,
get_record_id: Option<WalletGetRecordId>,
get_record_type: Option<WalletGetRecordType>,
get_record_value: Option<WalletGetRecordValue>,
get_record_tags: Option<WalletGetRecordTags>,
free_record: Option<WalletFreeRecord>,
get_storage_metadata: Option<WalletGetStorageMetadata>,
set_storage_metadata: Option<WalletSetStorageMetadata>,
free_storage_metadata: Option<WalletFreeStorageMetadata>,
search_records: Option<WalletSearchRecords>,
search_all_records: Option<WalletSearchAllRecords>,
get_search_total_count: Option<WalletGetSearchTotalCount>,
fetch_search_next_record: Option<WalletFetchSearchNextRecord>,
free_search: Option<WalletFreeSearch>,
timeout: Duration
) -> Result<(), ErrorCode>
pub fn register_storage_timeout(
xtype: &str,
create: Option<WalletCreate>,
open: Option<WalletOpen>,
close: Option<WalletClose>,
delete: Option<WalletDelete>,
add_record: Option<WalletAddRecord>,
update_record_value: Option<WalletUpdateRecordValue>,
update_record_tags: Option<WalletUpdateRecordTags>,
add_record_tags: Option<WalletAddRecordTags>,
delete_record_tags: Option<WalletDeleteRecordTags>,
delete_record: Option<WalletDeleteRecord>,
get_record: Option<WalletGetRecord>,
get_record_id: Option<WalletGetRecordId>,
get_record_type: Option<WalletGetRecordType>,
get_record_value: Option<WalletGetRecordValue>,
get_record_tags: Option<WalletGetRecordTags>,
free_record: Option<WalletFreeRecord>,
get_storage_metadata: Option<WalletGetStorageMetadata>,
set_storage_metadata: Option<WalletSetStorageMetadata>,
free_storage_metadata: Option<WalletFreeStorageMetadata>,
search_records: Option<WalletSearchRecords>,
search_all_records: Option<WalletSearchAllRecords>,
get_search_total_count: Option<WalletGetSearchTotalCount>,
fetch_search_next_record: Option<WalletFetchSearchNextRecord>,
free_search: Option<WalletFreeSearch>,
timeout: Duration
) -> Result<(), ErrorCode>
Registers custom wallet implementation.
It allows library user to provide custom wallet implementation.
Arguments
command_handle
- Command handle to map callback to caller context.xtype
- Wallet type name.create
- WalletType create operation handleropen
- WalletType open operation handlerset
- Wallet set operation handlerget
- Wallet get operation handlerget_not_expired
- Wallet get_not_expired operation handlerlist
- Wallet list operation handler(must to return data in the following format: {“values”:[{“key”:“”, “value”:“”}, {“key”:“”, “value”:“”}]}close
- Wallet close operation handlerdelete
- WalletType delete operation handlerfree
- Handler that allows to de-allocate strings allocated in caller codetimeout
- the maximum time this function waits for a response
sourcepub fn register_storage_async<F: 'static>(
xtype: &str,
create: Option<WalletCreate>,
open: Option<WalletOpen>,
close: Option<WalletClose>,
delete: Option<WalletDelete>,
add_record: Option<WalletAddRecord>,
update_record_value: Option<WalletUpdateRecordValue>,
update_record_tags: Option<WalletUpdateRecordTags>,
add_record_tags: Option<WalletAddRecordTags>,
delete_record_tags: Option<WalletDeleteRecordTags>,
delete_record: Option<WalletDeleteRecord>,
get_record: Option<WalletGetRecord>,
get_record_id: Option<WalletGetRecordId>,
get_record_type: Option<WalletGetRecordType>,
get_record_value: Option<WalletGetRecordValue>,
get_record_tags: Option<WalletGetRecordTags>,
free_record: Option<WalletFreeRecord>,
get_storage_metadata: Option<WalletGetStorageMetadata>,
set_storage_metadata: Option<WalletSetStorageMetadata>,
free_storage_metadata: Option<WalletFreeStorageMetadata>,
search_records: Option<WalletSearchRecords>,
search_all_records: Option<WalletSearchAllRecords>,
get_search_total_count: Option<WalletGetSearchTotalCount>,
fetch_search_next_record: Option<WalletFetchSearchNextRecord>,
free_search: Option<WalletFreeSearch>,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode) + Send,
pub fn register_storage_async<F: 'static>(
xtype: &str,
create: Option<WalletCreate>,
open: Option<WalletOpen>,
close: Option<WalletClose>,
delete: Option<WalletDelete>,
add_record: Option<WalletAddRecord>,
update_record_value: Option<WalletUpdateRecordValue>,
update_record_tags: Option<WalletUpdateRecordTags>,
add_record_tags: Option<WalletAddRecordTags>,
delete_record_tags: Option<WalletDeleteRecordTags>,
delete_record: Option<WalletDeleteRecord>,
get_record: Option<WalletGetRecord>,
get_record_id: Option<WalletGetRecordId>,
get_record_type: Option<WalletGetRecordType>,
get_record_value: Option<WalletGetRecordValue>,
get_record_tags: Option<WalletGetRecordTags>,
free_record: Option<WalletFreeRecord>,
get_storage_metadata: Option<WalletGetStorageMetadata>,
set_storage_metadata: Option<WalletSetStorageMetadata>,
free_storage_metadata: Option<WalletFreeStorageMetadata>,
search_records: Option<WalletSearchRecords>,
search_all_records: Option<WalletSearchAllRecords>,
get_search_total_count: Option<WalletGetSearchTotalCount>,
fetch_search_next_record: Option<WalletFetchSearchNextRecord>,
free_search: Option<WalletFreeSearch>,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode) + Send,
Registers custom wallet implementation.
It allows library user to provide custom wallet implementation.
Arguments
command_handle
- Command handle to map callback to caller context.xtype
- Wallet type name.create
- WalletType create operation handleropen
- WalletType open operation handlerset
- Wallet set operation handlerget
- Wallet get operation handlerget_not_expired
- Wallet get_not_expired operation handlerlist
- Wallet list operation handler(must to return data in the following format: {“values”:[{“key”:“”, “value”:“”}, {“key”:“”, “value”:“”}]}close
- Wallet close operation handlerdelete
- WalletType delete operation handlerfree
- Handler that allows to de-allocate strings allocated in caller codeclosure
- the closure that is called when finished
Returns
errorcode
- errorcode from calling ffi function. The closure receives the return result
sourcepub fn create(config: &str, credentials: &str) -> Result<(), ErrorCode>
pub fn create(config: &str, credentials: &str) -> Result<(), ErrorCode>
Creates a new secure wallet with the given unique name.
Arguments
config
- Wallet configuration json. List of supported keys are defined by wallet type. if NULL, then default config will be used.credentials
- Wallet credentials json. List of supported keys are defined by wallet type. if NULL, then default config will be used.
sourcepub fn create_timeout(
config: &str,
credentials: &str,
timeout: Duration
) -> Result<(), ErrorCode>
pub fn create_timeout(
config: &str,
credentials: &str,
timeout: Duration
) -> Result<(), ErrorCode>
Creates a new secure wallet with the given unique name.
Arguments
config
- Wallet configuration json. List of supported keys are defined by wallet type. if NULL, then default config will be used.credentials
- Wallet credentials json. List of supported keys are defined by wallet type. if NULL, then default config will be used.timeout
- the maximum time this function waits for a response
sourcepub fn create_async<F: 'static>(
config: &str,
credentials: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode) + Send,
pub fn create_async<F: 'static>(
config: &str,
credentials: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode) + Send,
Creates a new secure wallet with the given unique name.
Arguments
config
- Wallet configuration json. List of supported keys are defined by wallet type. if NULL, then default config will be used.credentials
- Wallet credentials json. List of supported keys are defined by wallet type. if NULL, then default config will be used.closure
- the closure that is called when finished
Returns
errorcode
- errorcode from calling ffi function. The closure receives the return result
sourcepub fn open(config: &str, credentials: &str) -> Result<i32, ErrorCode>
pub fn open(config: &str, credentials: &str) -> Result<i32, ErrorCode>
Opens the wallet with specific name.
Wallet with corresponded name must be previously created with indy_create_wallet method. It is impossible to open wallet with the same name more than once.
Arguments
runtime_config
(optional)- Runtime wallet configuration json. if NULL, then default runtime_config will be used. Example: { “freshness_time”: string (optional), Amount of minutes to consider wallet value as fresh. Defaults to 24*60. … List of additional supported keys are defined by wallet type. }credentials
(optional) - Wallet credentials json. List of supported keys are defined by wallet type. if NULL, then default credentials will be used.
Returns
Handle to opened wallet to use in methods that require wallet access.
sourcepub fn open_timeout(
config: &str,
credentials: &str,
timeout: Duration
) -> Result<i32, ErrorCode>
pub fn open_timeout(
config: &str,
credentials: &str,
timeout: Duration
) -> Result<i32, ErrorCode>
Opens the wallet with specific name.
Wallet with corresponded name must be previously created with indy_create_wallet method. It is impossible to open wallet with the same name more than once.
Arguments
runtime_config
(optional)- Runtime wallet configuration json. if NULL, then default runtime_config will be used. Example: { “freshness_time”: string (optional), Amount of minutes to consider wallet value as fresh. Defaults to 24*60. … List of additional supported keys are defined by wallet type. }credentials
(optional) - Wallet credentials json. List of supported keys are defined by wallet type. if NULL, then default credentials will be used.timeout
- the maximum time this function waits for a response
Returns
Handle to opened wallet to use in methods that require wallet access.
sourcepub fn open_async<F: 'static>(
config: &str,
credentials: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, i32) + Send,
pub fn open_async<F: 'static>(
config: &str,
credentials: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, i32) + Send,
Opens the wallet with specific name.
Wallet with corresponded name must be previously created with indy_create_wallet method. It is impossible to open wallet with the same name more than once.
Arguments
runtime_config
(optional)- Runtime wallet configuration json. if NULL, then default runtime_config will be used. Example: { “freshness_time”: string (optional), Amount of minutes to consider wallet value as fresh. Defaults to 24*60. … List of additional supported keys are defined by wallet type. }credentials
(optional) - Wallet credentials json. List of supported keys are defined by wallet type. if NULL, then default credentials will be used.closure
- the closure that is called when finished
Returns
errorcode
- errorcode from calling ffi function. The closure receives the return result
sourcepub fn export(
wallet_handle: IndyHandle,
export_config: &str
) -> Result<(), ErrorCode>
pub fn export(
wallet_handle: IndyHandle,
export_config: &str
) -> Result<(), ErrorCode>
Exports opened wallet
Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change in the future releases.
Arguments:
wallet_handle
- wallet handle returned by indy_open_walletexport_config
- JSON containing settings for input operation. { “path”: path of the file that contains exported wallet content “key”: passphrase used to derive export key }
sourcepub fn export_timeout(
wallet_handle: IndyHandle,
export_config: &str,
timeout: Duration
) -> Result<(), ErrorCode>
pub fn export_timeout(
wallet_handle: IndyHandle,
export_config: &str,
timeout: Duration
) -> Result<(), ErrorCode>
Exports opened wallet
Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change in the future releases.
Arguments:
wallet_handle
- wallet handle returned by indy_open_walletexport_config
- JSON containing settings for input operation. { “path”: path of the file that contains exported wallet content “key”: passphrase used to derive export key }timeout
- the maximum time this function waits for a response
sourcepub fn export_async<F: 'static>(
wallet_handle: IndyHandle,
export_config: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode) + Send,
pub fn export_async<F: 'static>(
wallet_handle: IndyHandle,
export_config: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode) + Send,
Exports opened wallet
Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change in the future releases.
Arguments:
wallet_handle
- wallet handle returned by indy_open_walletexport_config
- JSON containing settings for input operation. { “path”: path of the file that contains exported wallet content “key”: passphrase used to derive export key }closure
- the closure that is called when finished
Returns
errorcode
- errorcode from calling ffi function. The closure receives the return result
sourcepub fn import(
config: &str,
credentials: &str,
import_config: &str
) -> Result<(), ErrorCode>
pub fn import(
config: &str,
credentials: &str,
import_config: &str
) -> Result<(), ErrorCode>
Creates a new secure wallet with the given unique name and then imports its content according to fields provided in import_config This can be seen as an Wallet::create call with additional content import
Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change in the future releases.
Arguments
-
config
- Wallet configuration json. { “storage”: -
credentials
- Wallet credentials json (if NULL, then default config will be used). { “key”: string, “storage”: Optional}
-
import_config
- JSON containing settings for input operation. { “path”: path of the file that contains exported wallet content “key”: passphrase used to derive export key }
sourcepub fn import_timeout(
config: &str,
credentials: &str,
import_config: &str,
timeout: Duration
) -> Result<(), ErrorCode>
pub fn import_timeout(
config: &str,
credentials: &str,
import_config: &str,
timeout: Duration
) -> Result<(), ErrorCode>
Creates a new secure wallet with the given unique name and then imports its content according to fields provided in import_config This can be seen as an Wallet::create call with additional content import
Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change in the future releases.
Arguments
-
config
- Wallet configuration json. { “storage”: -
credentials
- Wallet credentials json (if NULL, then default config will be used). { “key”: string, “storage”: Optional}
-
import_config
- JSON containing settings for input operation. { “path”: path of the file that contains exported wallet content “key”: passphrase used to derive export key } -
timeout
- the maximum time this function waits for a response
sourcepub fn import_async<F: 'static>(
config: &str,
credentials: &str,
import_config: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode) + Send,
pub fn import_async<F: 'static>(
config: &str,
credentials: &str,
import_config: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode) + Send,
Creates a new secure wallet with the given unique name and then imports its content according to fields provided in import_config This can be seen as an Wallet::create call with additional content import
Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change in the future releases.
Arguments
-
config
- Wallet configuration json. { “storage”: -
credentials
- Wallet credentials json (if NULL, then default config will be used). { “key”: string, “storage”: Optional}
-
import_config_json
- JSON containing settings for input operation. { “path”: path of the file that contains exported wallet content “key”: passphrase used to derive export key } -
closure
- the closure that is called when finished
Returns
errorcode
- errorcode from calling ffi function. The closure receives the return result
sourcepub fn delete(config: &str, credentials: &str) -> Result<(), ErrorCode>
pub fn delete(config: &str, credentials: &str) -> Result<(), ErrorCode>
Deletes created wallet.
sourcepub fn delete_timeout(
config: &str,
credentials: &str,
timeout: Duration
) -> Result<(), ErrorCode>
pub fn delete_timeout(
config: &str,
credentials: &str,
timeout: Duration
) -> Result<(), ErrorCode>
sourcepub fn delete_async<F: 'static>(
config: &str,
credentials: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode) + Send,
pub fn delete_async<F: 'static>(
config: &str,
credentials: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode) + Send,
sourcepub fn close(wallet_handle: IndyHandle) -> Result<(), ErrorCode>
pub fn close(wallet_handle: IndyHandle) -> Result<(), ErrorCode>
Closes opened wallet and frees allocated resources.
Arguments
handle
- wallet handle returned by Wallet::open.
sourcepub fn close_timeout(
wallet_handle: IndyHandle,
timeout: Duration
) -> Result<(), ErrorCode>
pub fn close_timeout(
wallet_handle: IndyHandle,
timeout: Duration
) -> Result<(), ErrorCode>
Closes opened wallet and frees allocated resources.
Arguments
handle
- wallet handle returned by Wallet::open.timeout
- the maximum time this function waits for a response
sourcepub fn close_async<F: 'static>(
wallet_handle: IndyHandle,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode) + Send,
pub fn close_async<F: 'static>(
wallet_handle: IndyHandle,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode) + Send,
sourcepub fn add_record(
wallet_handle: IndyHandle,
xtype: &str,
id: &str,
value: &str,
tags_json: Option<&str>
) -> Result<(), ErrorCode>
pub fn add_record(
wallet_handle: IndyHandle,
xtype: &str,
id: &str,
value: &str,
tags_json: Option<&str>
) -> Result<(), ErrorCode>
Create a new non-secret record in the wallet
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- allows to separate different record types collectionsid
- the id of recordvalue
- the value of recordtags_json
- the record tags used for search and storing meta information as json: { “tagName1”:, // string tag (will be stored encrypted) “tagName2”: , // string tag (will be stored encrypted) “~tagName3”: , // string tag (will be stored un-encrypted) “~tagName4”: , // string tag (will be stored un-encrypted) } Note that null means no tags If tag name starts with “~” the tag will be stored un-encrypted that will allow usage of this tag in complex search queries (comparison, predicates) Encrypted tags can be searched only for exact matching
sourcepub fn add_record_timeout(
wallet_handle: IndyHandle,
xtype: &str,
id: &str,
value: &str,
tags_json: Option<&str>,
timeout: Duration
) -> Result<(), ErrorCode>
pub fn add_record_timeout(
wallet_handle: IndyHandle,
xtype: &str,
id: &str,
value: &str,
tags_json: Option<&str>,
timeout: Duration
) -> Result<(), ErrorCode>
Create a new non-secret record in the wallet
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- allows to separate different record types collectionsid
- the id of recordvalue
- the value of recordtags_json
- the record tags used for search and storing meta information as json: { “tagName1”:, // string tag (will be stored encrypted) “tagName2”: , // string tag (will be stored encrypted) “~tagName3”: , // string tag (will be stored un-encrypted) “~tagName4”: , // string tag (will be stored un-encrypted) } Note that null means no tags If tag name starts with “~” the tag will be stored un-encrypted that will allow usage of this tag in complex search queries (comparison, predicates) Encrypted tags can be searched only for exact matching timeout
- the maximum time this function waits for a response
sourcepub fn add_record_async<F: 'static>(
wallet_handle: IndyHandle,
xtype: &str,
id: &str,
value: &str,
tags_json: Option<&str>,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode) + Send,
pub fn add_record_async<F: 'static>(
wallet_handle: IndyHandle,
xtype: &str,
id: &str,
value: &str,
tags_json: Option<&str>,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode) + Send,
Create a new non-secret record in the wallet
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- allows to separate different record types collectionsid
- the id of recordvalue
- the value of recordtags_json
- the record tags used for search and storing meta information as json: { “tagName1”:, // string tag (will be stored encrypted) “tagName2”: , // string tag (will be stored encrypted) “~tagName3”: , // string tag (will be stored un-encrypted) “~tagName4”: , // string tag (will be stored un-encrypted) } Note that null means no tags If tag name starts with “~” the tag will be stored un-encrypted that will allow usage of this tag in complex search queries (comparison, predicates) Encrypted tags can be searched only for exact matching closure
- the closure that is called when finished
Returns
errorcode
- errorcode from calling ffi function. The closure receives the return result
sourcepub fn update_record_value(
wallet_handle: IndyHandle,
xtype: &str,
id: &str,
value: &str
) -> Result<(), ErrorCode>
pub fn update_record_value(
wallet_handle: IndyHandle,
xtype: &str,
id: &str,
value: &str
) -> Result<(), ErrorCode>
Update a non-secret wallet record value
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- allows to separate different record types collectionsid
- the id of recordvalue
- the new value of record
sourcepub fn update_record_value_timeout(
wallet_handle: IndyHandle,
xtype: &str,
id: &str,
value: &str,
timeout: Duration
) -> Result<(), ErrorCode>
pub fn update_record_value_timeout(
wallet_handle: IndyHandle,
xtype: &str,
id: &str,
value: &str,
timeout: Duration
) -> Result<(), ErrorCode>
Update a non-secret wallet record value
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- allows to separate different record types collectionsid
- the id of recordvalue
- the new value of recordtimeout
- the maximum time this function waits for a response
sourcepub fn update_record_value_async<F: 'static>(
wallet_handle: IndyHandle,
xtype: &str,
id: &str,
value: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode) + Send,
pub fn update_record_value_async<F: 'static>(
wallet_handle: IndyHandle,
xtype: &str,
id: &str,
value: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode) + Send,
Update a non-secret wallet record value
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- allows to separate different record types collectionsid
- the id of recordvalue
- the new value of recordclosure
- the closure that is called when finished
Returns
errorcode
- errorcode from calling ffi function. The closure receives the return result
Update a non-secret wallet record tags
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- allows to separate different record types collectionsid
- the id of recordtags_json
- the record tags used for search and storing meta information as json: { “tagName1”:, // string tag (will be stored encrypted) “tagName2”: , // string tag (will be stored encrypted) “~tagName3”: , // string tag (will be stored un-encrypted) “~tagName4”: , // string tag (will be stored un-encrypted) } If tag name starts with “~” the tag will be stored un-encrypted that will allow usage of this tag in complex search queries (comparison, predicates) Encrypted tags can be searched only for exact matching
Update a non-secret wallet record tags
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- allows to separate different record types collectionsid
- the id of recordtags_json
- the record tags used for search and storing meta information as json: { “tagName1”:, // string tag (will be stored encrypted) “tagName2”: , // string tag (will be stored encrypted) “~tagName3”: , // string tag (will be stored un-encrypted) “~tagName4”: , // string tag (will be stored un-encrypted) } If tag name starts with “~” the tag will be stored un-encrypted that will allow usage of this tag in complex search queries (comparison, predicates) Encrypted tags can be searched only for exact matching timeout
- the maximum time this function waits for a response
Update a non-secret wallet record tags
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- allows to separate different record types collectionsid
- the id of recordtags_json
- the record tags used for search and storing meta information as json: { “tagName1”:, // string tag (will be stored encrypted) “tagName2”: , // string tag (will be stored encrypted) “~tagName3”: , // string tag (will be stored un-encrypted) “~tagName4”: , // string tag (will be stored un-encrypted) } If tag name starts with “~” the tag will be stored un-encrypted that will allow usage of this tag in complex search queries (comparison, predicates) Encrypted tags can be searched only for exact matching closure
- the closure that is called when finished
Returns
errorcode
- errorcode from calling ffi function. The closure receives the return result
Add new tags to the wallet record
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- allows to separate different record types collectionsid
- the id of recordtags_json
- the record tags used for search and storing meta information as json: { “tagName1”:, // string tag (will be stored encrypted) “tagName2”: , // string tag (will be stored encrypted) “~tagName3”: , // string tag (will be stored un-encrypted) “~tagName4”: , // string tag (will be stored un-encrypted) } If tag name starts with “~” the tag will be stored un-encrypted that will allow usage of this tag in complex search queries (comparison, predicates) Encrypted tags can be searched only for exact matching Note if some from provided tags already assigned to the record than corresponding tags values will be replaced
Add new tags to the wallet record
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- allows to separate different record types collectionsid
- the id of recordtags_json
- the record tags used for search and storing meta information as json: { “tagName1”:, // string tag (will be stored encrypted) “tagName2”: , // string tag (will be stored encrypted) “~tagName3”: , // string tag (will be stored un-encrypted) “~tagName4”: , // string tag (will be stored un-encrypted) } If tag name starts with “~” the tag will be stored un-encrypted that will allow usage of this tag in complex search queries (comparison, predicates) Encrypted tags can be searched only for exact matching Note if some from provided tags already assigned to the record than corresponding tags values will be replaced timeout
- the maximum time this function waits for a response
Add new tags to the wallet record
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- allows to separate different record types collectionsid
- the id of recordtags_json
- the record tags used for search and storing meta information as json: { “tagName1”:, // string tag (will be stored encrypted) “tagName2”: , // string tag (will be stored encrypted) “~tagName3”: , // string tag (will be stored un-encrypted) “~tagName4”: , // string tag (will be stored un-encrypted) } If tag name starts with “~” the tag will be stored un-encrypted that will allow usage of this tag in complex search queries (comparison, predicates) Encrypted tags can be searched only for exact matching Note if some from provided tags already assigned to the record than corresponding tags values will be replaced closure
- the closure that is called when finished
Returns
errorcode
- errorcode from calling ffi function. The closure receives the return result
Delete tags from the wallet record
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- allows to separate different record types collectionsid
- the id of recordtag_names_json
- the list of tag names to remove from the record as json array: [“tagName1”, “tagName2”, …]
Delete tags from the wallet record
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- allows to separate different record types collectionsid
- the id of recordtag_names_json
- the list of tag names to remove from the record as json array: [“tagName1”, “tagName2”, …]timeout
- the maximum time this function waits for a response
Delete tags from the wallet record
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- allows to separate different record types collectionsid
- the id of recordtag_names_json
- the list of tag names to remove from the record as json array: [“tagName1”, “tagName2”, …]closure
- the closure that is called when finished
Returns
errorcode
- errorcode from calling ffi function. The closure receives the return result
sourcepub fn delete_record(
wallet_handle: IndyHandle,
xtype: &str,
id: &str
) -> Result<(), ErrorCode>
pub fn delete_record(
wallet_handle: IndyHandle,
xtype: &str,
id: &str
) -> Result<(), ErrorCode>
Delete an existing wallet record in the wallet
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- record typeid
- the id of record
sourcepub fn delete_record_timeout(
wallet_handle: IndyHandle,
xtype: &str,
id: &str,
timeout: Duration
) -> Result<(), ErrorCode>
pub fn delete_record_timeout(
wallet_handle: IndyHandle,
xtype: &str,
id: &str,
timeout: Duration
) -> Result<(), ErrorCode>
Delete an existing wallet record in the wallet
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- record typeid
- the id of recordtimeout
- the maximum time this function waits for a response
sourcepub fn delete_record_async<F: 'static>(
wallet_handle: IndyHandle,
xtype: &str,
id: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode) + Send,
pub fn delete_record_async<F: 'static>(
wallet_handle: IndyHandle,
xtype: &str,
id: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode) + Send,
Delete an existing wallet record in the wallet
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- record typeid
- the id of recordclosure
- the closure that is called when finished
Returns
errorcode
- errorcode from calling ffi function. The closure receives the return result
sourcepub fn get_record(
wallet_handle: IndyHandle,
xtype: &str,
id: &str,
options_json: &str
) -> Result<String, ErrorCode>
pub fn get_record(
wallet_handle: IndyHandle,
xtype: &str,
id: &str,
options_json: &str
) -> Result<String, ErrorCode>
Get an wallet record by id
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- allows to separate different record types collectionsid
- the id of recordoptions_json
- //TODO: FIXME: Think about replacing by bitmaks { retrieveType: (optional, false by default) Retrieve record type, retrieveValue: (optional, true by default) Retrieve record value, retrieveTags: (optional, false by default) Retrieve record tags }
Returns
wallet record json
- { id: “Some id”, type: “Some type”, // present only if retrieveType set to true value: “Some value”, // present only if retrieveValue set to true tags:, // present only if retrieveTags set to true }
sourcepub fn get_record_timeout(
wallet_handle: IndyHandle,
xtype: &str,
id: &str,
options_json: &str,
timeout: Duration
) -> Result<String, ErrorCode>
pub fn get_record_timeout(
wallet_handle: IndyHandle,
xtype: &str,
id: &str,
options_json: &str,
timeout: Duration
) -> Result<String, ErrorCode>
Get an wallet record by id
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- allows to separate different record types collectionsid
- the id of recordoptions_json
- //TODO: FIXME: Think about replacing by bitmaks { retrieveType: (optional, false by default) Retrieve record type, retrieveValue: (optional, true by default) Retrieve record value, retrieveTags: (optional, false by default) Retrieve record tags }timeout
- the maximum time this function waits for a response
Returns
wallet record json
- { id: “Some id”, type: “Some type”, // present only if retrieveType set to true value: “Some value”, // present only if retrieveValue set to true tags:, // present only if retrieveTags set to true }
sourcepub fn get_record_async<F: 'static>(
wallet_handle: IndyHandle,
xtype: &str,
id: &str,
options_json: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, String) + Send,
pub fn get_record_async<F: 'static>(
wallet_handle: IndyHandle,
xtype: &str,
id: &str,
options_json: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, String) + Send,
Get an wallet record by id
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- allows to separate different record types collectionsid
- the id of recordoptions_json
- //TODO: FIXME: Think about replacing by bitmaks { retrieveType: (optional, false by default) Retrieve record type, retrieveValue: (optional, true by default) Retrieve record value, retrieveTags: (optional, false by default) Retrieve record tags }closure
- the closure that is called when finished
Returns
errorcode
- errorcode from calling ffi function. The closure receives the return result
sourcepub fn open_search(
wallet_handle: IndyHandle,
xtype: &str,
query_json: &str,
options_json: &str
) -> Result<IndyHandle, ErrorCode>
pub fn open_search(
wallet_handle: IndyHandle,
xtype: &str,
query_json: &str,
options_json: &str
) -> Result<IndyHandle, ErrorCode>
Search for wallet records.
Note instead of immediately returning of fetched records this call returns wallet_search_handle that can be used later to fetch records by small batches (with indy_fetch_wallet_search_next_records).
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- allows to separate different record types collectionsquery_json
- MongoDB style query to wallet record tags: { “tagName”: “tagValue”, $or: { “tagName2”: { $regex: ‘pattern’ }, “tagName3”: { $gte: ‘123’ }, }, }options_json
- //TODO: FIXME: Think about replacing by bitmaks { retrieveRecords: (optional, true by default) If false only “counts” will be calculated, retrieveTotalCount: (optional, false by default) Calculate total count, retrieveType: (optional, false by default) Retrieve record type, retrieveValue: (optional, true by default) Retrieve record value, retrieveTags: (optional, false by default) Retrieve record tags, }
Returns
search_handle
- Wallet search handle that can be used later to fetch records by small batches (with indy_fetch_wallet_search_next_records)
sourcepub fn open_search_timeout(
wallet_handle: IndyHandle,
xtype: &str,
query_json: &str,
options_json: &str,
timeout: Duration
) -> Result<IndyHandle, ErrorCode>
pub fn open_search_timeout(
wallet_handle: IndyHandle,
xtype: &str,
query_json: &str,
options_json: &str,
timeout: Duration
) -> Result<IndyHandle, ErrorCode>
Search for wallet records.
Note instead of immediately returning of fetched records this call returns wallet_search_handle that can be used later to fetch records by small batches (with indy_fetch_wallet_search_next_records).
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- allows to separate different record types collectionsquery_json
- MongoDB style query to wallet record tags: { “tagName”: “tagValue”, $or: { “tagName2”: { $regex: ‘pattern’ }, “tagName3”: { $gte: ‘123’ }, }, }options_json
- //TODO: FIXME: Think about replacing by bitmaks { retrieveRecords: (optional, true by default) If false only “counts” will be calculated, retrieveTotalCount: (optional, false by default) Calculate total count, retrieveType: (optional, false by default) Retrieve record type, retrieveValue: (optional, true by default) Retrieve record value, retrieveTags: (optional, false by default) Retrieve record tags, }timeout
- the maximum time this function waits for a response
Returns
search_handle
- Wallet search handle that can be used later to fetch records by small batches (with indy_fetch_wallet_search_next_records)
sourcepub fn open_search_async<F: 'static>(
wallet_handle: IndyHandle,
xtype: &str,
query_json: &str,
options_json: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, IndyHandle) + Send,
pub fn open_search_async<F: 'static>(
wallet_handle: IndyHandle,
xtype: &str,
query_json: &str,
options_json: &str,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, IndyHandle) + Send,
Search for wallet records.
Note instead of immediately returning of fetched records this call returns wallet_search_handle that can be used later to fetch records by small batches (with indy_fetch_wallet_search_next_records).
Arguments
wallet_handle
- wallet handle (created by open_wallet)xtype
- allows to separate different record types collectionsquery_json
- MongoDB style query to wallet record tags: { “tagName”: “tagValue”, $or: { “tagName2”: { $regex: ‘pattern’ }, “tagName3”: { $gte: ‘123’ }, }, }options_json
- //TODO: FIXME: Think about replacing by bitmaks { retrieveRecords: (optional, true by default) If false only “counts” will be calculated, retrieveTotalCount: (optional, false by default) Calculate total count, retrieveType: (optional, false by default) Retrieve record type, retrieveValue: (optional, true by default) Retrieve record value, retrieveTags: (optional, false by default) Retrieve record tags, }closure
- the closure that is called when finished
Returns
errorcode
- errorcode from calling ffi function. The closure receives the return result
sourcepub fn fetch_search_next_records(
wallet_handle: IndyHandle,
wallet_search_handle: IndyHandle,
count: usize
) -> Result<String, ErrorCode>
pub fn fetch_search_next_records(
wallet_handle: IndyHandle,
wallet_search_handle: IndyHandle,
count: usize
) -> Result<String, ErrorCode>
Fetch next records for wallet search.
Not if there are no records this call returns WalletNoRecords error.
Arguments
wallet_handle
- wallet handle (created by open_wallet)wallet_search_handle
- wallet search handle (created by indy_open_wallet_search)count
- Count of records to fetch
Returns
wallet records json
- { totalCount:, // present only if retrieveTotalCount set to true records: [{ // present only if retrieveRecords set to true id: “Some id”, type: “Some type”, // present only if retrieveType set to true value: “Some value”, // present only if retrieveValue set to true tags: , // present only if retrieveTags set to true }], }
sourcepub fn fetch_search_next_records_timeout(
wallet_handle: IndyHandle,
wallet_search_handle: IndyHandle,
count: usize,
timeout: Duration
) -> Result<String, ErrorCode>
pub fn fetch_search_next_records_timeout(
wallet_handle: IndyHandle,
wallet_search_handle: IndyHandle,
count: usize,
timeout: Duration
) -> Result<String, ErrorCode>
Fetch next records for wallet search.
Not if there are no records this call returns WalletNoRecords error.
Arguments
wallet_handle
- wallet handle (created by open_wallet)wallet_search_handle
- wallet search handle (created by indy_open_wallet_search)count
- Count of records to fetchtimeout
- the maximum time this function waits for a response
Returns
wallet records json
- { totalCount:, // present only if retrieveTotalCount set to true records: [{ // present only if retrieveRecords set to true id: “Some id”, type: “Some type”, // present only if retrieveType set to true value: “Some value”, // present only if retrieveValue set to true tags: , // present only if retrieveTags set to true }], }
sourcepub fn fetch_search_next_records_async<F: 'static>(
wallet_handle: IndyHandle,
wallet_search_handle: IndyHandle,
count: usize,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, String) + Send,
pub fn fetch_search_next_records_async<F: 'static>(
wallet_handle: IndyHandle,
wallet_search_handle: IndyHandle,
count: usize,
closure: F
) -> ErrorCodewhere
F: FnMut(ErrorCode, String) + Send,
Fetch next records for wallet search.
Not if there are no records this call returns WalletNoRecords error.
Arguments
wallet_handle
- wallet handle (created by open_wallet)wallet_search_handle
- wallet search handle (created by indy_open_wallet_search)count
- Count of records to fetchclosure
- the closure that is called when finished
Returns
errorcode
- errorcode from calling ffi function. The closure receives the return result
sourcepub fn close_search(wallet_search_handle: IndyHandle) -> Result<(), ErrorCode>
pub fn close_search(wallet_search_handle: IndyHandle) -> Result<(), ErrorCode>
Close wallet search (make search handle invalid)
Arguments
wallet_search_handle
- wallet search handle
sourcepub fn close_search_timeout(
wallet_search_handle: IndyHandle,
timeout: Duration
) -> Result<(), ErrorCode>
pub fn close_search_timeout(
wallet_search_handle: IndyHandle,
timeout: Duration
) -> Result<(), ErrorCode>
Close wallet search (make search handle invalid)
Arguments
wallet_search_handle
- wallet search handletimeout
- the maximum time this function waits for a response