pub struct Pool {}Implementations§
Source§impl Pool
impl Pool
Sourcepub fn create_ledger_config(
pool_name: &str,
pool_config: Option<&str>,
) -> Result<(), ErrorCode>
pub fn create_ledger_config( pool_name: &str, pool_config: Option<&str>, ) -> Result<(), ErrorCode>
Creates a new local pool ledger configuration that can be used later to connect pool nodes.
§Arguments
config_name- Name of the pool ledger configuration.config(optional)- Pool configuration json. if NULL, then default config will be used. Example: { “genesis_txn”: string (optional), A path to genesis transaction file. If NULL, then a default one will be used. If file doesn’t exists default one will be created. }
Sourcepub fn create_ledger_config_timeout(
pool_name: &str,
pool_config: Option<&str>,
timeout: Duration,
) -> Result<(), ErrorCode>
pub fn create_ledger_config_timeout( pool_name: &str, pool_config: Option<&str>, timeout: Duration, ) -> Result<(), ErrorCode>
Creates a new local pool ledger configuration that can be used later to connect pool nodes.
§Arguments
config_name- Name of the pool ledger configuration.config(optional)- Pool configuration json. if NULL, then default config will be used. Example: { “genesis_txn”: string (optional), A path to genesis transaction file. If NULL, then a default one will be used. If file doesn’t exists default one will be created. }timeout- the maximum time this function waits for a response
Sourcepub fn create_ledger_config_async<F>(
pool_name: &str,
pool_config: Option<&str>,
closure: F,
) -> ErrorCode
pub fn create_ledger_config_async<F>( pool_name: &str, pool_config: Option<&str>, closure: F, ) -> ErrorCode
Creates a new local pool ledger configuration that can be used later to connect pool nodes.
§Arguments
config_name- Name of the pool ledger configuration.config(optional)- Pool configuration json. if NULL, then default config will be used. Example:closure- the closure that is called when finished
§Returns
errorcode- errorcode from calling ffi function. The closure receives the return result
Sourcepub fn open_ledger(
pool_name: &str,
config: Option<&str>,
) -> Result<IndyHandle, ErrorCode>
pub fn open_ledger( pool_name: &str, config: Option<&str>, ) -> Result<IndyHandle, ErrorCode>
Opens pool ledger and performs connecting to pool nodes.
Pool ledger configuration with corresponded name must be previously created with indy_create_pool_ledger_config method. It is impossible to open pool with the same name more than once.
§Arguments
config_name- Name of the pool ledger configuration.config(optional)- Runtime pool configuration json. if NULL, then default config will be used. Example: { “refresh_on_open”: bool (optional), Forces pool ledger to be refreshed immediately after opening. Defaults to true. “auto_refresh_time”: int (optional), After this time in minutes pool ledger will be automatically refreshed. Use 0 to disable automatic refresh. Defaults to 24*60. “network_timeout”: int (optional), Network timeout for communication with nodes in milliseconds. Defaults to 20000. }
§Returns
Handle to opened pool to use in methods that require pool connection.
Sourcepub fn open_ledger_timeout(
pool_name: &str,
config: Option<&str>,
timeout: Duration,
) -> Result<IndyHandle, ErrorCode>
pub fn open_ledger_timeout( pool_name: &str, config: Option<&str>, timeout: Duration, ) -> Result<IndyHandle, ErrorCode>
Opens pool ledger and performs connecting to pool nodes.
Pool ledger configuration with corresponded name must be previously created with indy_create_pool_ledger_config method. It is impossible to open pool with the same name more than once.
§Arguments
config_name- Name of the pool ledger configuration.config(optional)- Runtime pool configuration json. if NULL, then default config will be used. Example: { “refresh_on_open”: bool (optional), Forces pool ledger to be refreshed immediately after opening. Defaults to true. “auto_refresh_time”: int (optional), After this time in minutes pool ledger will be automatically refreshed. Use 0 to disable automatic refresh. Defaults to 24*60. “network_timeout”: int (optional), Network timeout for communication with nodes in milliseconds. Defaults to 20000. }timeout- the maximum time this function waits for a response
§Returns
Handle to opened pool to use in methods that require pool connection.
Sourcepub fn open_ledger_async<F>(
pool_name: &str,
config: Option<&str>,
closure: F,
) -> ErrorCode
pub fn open_ledger_async<F>( pool_name: &str, config: Option<&str>, closure: F, ) -> ErrorCode
Opens pool ledger and performs connecting to pool nodes.
Pool ledger configuration with corresponded name must be previously created with indy_create_pool_ledger_config method. It is impossible to open pool with the same name more than once.
§Arguments
config_name- Name of the pool ledger configuration.config(optional)- Runtime pool configuration json. if NULL, then default config will be used. Example: { “refresh_on_open”: bool (optional), Forces pool ledger to be refreshed immediately after opening. Defaults to true. “auto_refresh_time”: int (optional), After this time in minutes pool ledger will be automatically refreshed. Use 0 to disable automatic refresh. Defaults to 24*60. “network_timeout”: int (optional), Network timeout for communication with nodes in milliseconds. Defaults to 20000. }closure- the closure that is called when finished
§Returns
errorcode- errorcode from calling ffi function. The closure receives the return result
Sourcepub fn refresh(pool_handle: IndyHandle) -> Result<(), ErrorCode>
pub fn refresh(pool_handle: IndyHandle) -> Result<(), ErrorCode>
Refreshes a local copy of a pool ledger and updates pool nodes connections.
§Arguments
handle- pool handle returned by Pool::open_ledger
Sourcepub fn refresh_timeout(
pool_handle: IndyHandle,
timeout: Duration,
) -> Result<(), ErrorCode>
pub fn refresh_timeout( pool_handle: IndyHandle, timeout: Duration, ) -> Result<(), ErrorCode>
Refreshes a local copy of a pool ledger and updates pool nodes connections.
§Arguments
handle- pool handle returned by Pool::open_ledgertimeout- the maximum time this function waits for a response
Sourcepub fn refresh_async<F>(pool_handle: IndyHandle, closure: F) -> ErrorCode
pub fn refresh_async<F>(pool_handle: IndyHandle, closure: F) -> ErrorCode
Sourcepub fn list_timeout(timeout: Duration) -> Result<String, ErrorCode>
pub fn list_timeout(timeout: Duration) -> Result<String, ErrorCode>
Lists names of created pool ledgers
timeout- the maximum time this function waits for a response
Sourcepub fn list_async<F>(closure: F) -> ErrorCode
pub fn list_async<F>(closure: F) -> ErrorCode
Lists names of created pool ledgers
closure- the closure that is called when finished
§Returns
errorcode- errorcode from calling ffi function. The closure receives the return result
Sourcepub fn close(pool_handle: IndyHandle) -> Result<(), ErrorCode>
pub fn close(pool_handle: IndyHandle) -> Result<(), ErrorCode>
Closes opened pool ledger, opened nodes connections and frees allocated resources.
§Arguments
handle- pool handle returned by Pool::open_ledger.
Sourcepub fn close_timeout(
pool_handle: IndyHandle,
timeout: Duration,
) -> Result<(), ErrorCode>
pub fn close_timeout( pool_handle: IndyHandle, timeout: Duration, ) -> Result<(), ErrorCode>
Closes opened pool ledger, opened nodes connections and frees allocated resources.
§Arguments
handle- pool handle returned by Pool::open_ledger.timeout- the maximum time this function waits for a response
Sourcepub fn close_async<F>(pool_handle: IndyHandle, closure: F) -> ErrorCode
pub fn close_async<F>(pool_handle: IndyHandle, closure: F) -> ErrorCode
Sourcepub fn delete(pool_name: &str) -> Result<(), ErrorCode>
pub fn delete(pool_name: &str) -> Result<(), ErrorCode>
Deletes created pool ledger configuration.
§Arguments
config_name- Name of the pool ledger configuration to delete.
Sourcepub fn delete_timeout(
pool_name: &str,
timeout: Duration,
) -> Result<(), ErrorCode>
pub fn delete_timeout( pool_name: &str, timeout: Duration, ) -> Result<(), ErrorCode>
Deletes created pool ledger configuration.
§Arguments
config_name- Name of the pool ledger configuration to delete.timeout- the maximum time this function waits for a response
Sourcepub fn delete_async<F>(pool_name: &str, closure: F) -> ErrorCode
pub fn delete_async<F>(pool_name: &str, closure: F) -> ErrorCode
Sourcepub fn set_protocol_version(protocol_version: usize) -> Result<(), ErrorCode>
pub fn set_protocol_version(protocol_version: usize) -> Result<(), ErrorCode>
Set PROTOCOL_VERSION to specific version.
There is a global property PROTOCOL_VERSION that used in every request to the pool and specified version of Indy Node which Libindy works.
By default PROTOCOL_VERSION=1.
§Arguments
protocol_version- Protocol version will be used: 1 - for Indy Node 1.3 2 - for Indy Node 1.4
Sourcepub fn set_protocol_version_timeout(
protocol_version: usize,
timeout: Duration,
) -> Result<(), ErrorCode>
pub fn set_protocol_version_timeout( protocol_version: usize, timeout: Duration, ) -> Result<(), ErrorCode>
Set PROTOCOL_VERSION to specific version.
There is a global property PROTOCOL_VERSION that used in every request to the pool and specified version of Indy Node which Libindy works.
By default PROTOCOL_VERSION=1.
§Arguments
protocol_version- Protocol version will be used: 1 - for Indy Node 1.3 2 - for Indy Node 1.4timeout- the maximum time this function waits for a response
Sourcepub fn set_protocol_version_async<F>(
protocol_version: usize,
closure: F,
) -> ErrorCode
pub fn set_protocol_version_async<F>( protocol_version: usize, closure: F, ) -> ErrorCode
Set PROTOCOL_VERSION to specific version.
There is a global property PROTOCOL_VERSION that used in every request to the pool and specified version of Indy Node which Libindy works.
By default PROTOCOL_VERSION=1.
§Arguments
protocol_version- Protocol version will be used: 1 - for Indy Node 1.3 2 - for Indy Node 1.4closure- the closure that is called when finished
§Returns
errorcode- errorcode from calling ffi function. The closure receives the return result