Struct rust_libindy_wrapper::pool::Pool [−][src]
pub struct Pool {}Methods
impl Pool[src]
impl Poolpub fn create_ledger_config(
pool_name: &str,
pool_config: Option<&str>
) -> Result<(), ErrorCode>[src]
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. }
pub fn create_ledger_config_timeout(
pool_name: &str,
pool_config: Option<&str>,
timeout: Duration
) -> Result<(), ErrorCode>[src]
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
pub fn create_ledger_config_async<F: 'static>(
pool_name: &str,
pool_config: Option<&str>,
closure: F
) -> ErrorCode where
F: FnMut(ErrorCode) + Send, [src]
pub fn create_ledger_config_async<F: 'static>(
pool_name: &str,
pool_config: Option<&str>,
closure: F
) -> ErrorCode where
F: FnMut(ErrorCode) + Send, 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
pub fn open_ledger(
pool_name: &str,
config: Option<&str>
) -> Result<IndyHandle, ErrorCode>[src]
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.
pub fn open_ledger_timeout(
pool_name: &str,
config: Option<&str>,
timeout: Duration
) -> Result<IndyHandle, ErrorCode>[src]
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.
pub fn open_ledger_async<F: 'static>(
pool_name: &str,
config: Option<&str>,
closure: F
) -> ErrorCode where
F: FnMut(ErrorCode, IndyHandle) + Send, [src]
pub fn open_ledger_async<F: 'static>(
pool_name: &str,
config: Option<&str>,
closure: F
) -> ErrorCode where
F: FnMut(ErrorCode, IndyHandle) + Send, 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
pub fn refresh(pool_handle: IndyHandle) -> Result<(), ErrorCode>[src]
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
pub fn refresh_timeout(
pool_handle: IndyHandle,
timeout: Duration
) -> Result<(), ErrorCode>[src]
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
pub fn refresh_async<F: 'static>(
pool_handle: IndyHandle,
closure: F
) -> ErrorCode where
F: FnMut(ErrorCode) + Send, [src]
pub fn refresh_async<F: 'static>(
pool_handle: IndyHandle,
closure: F
) -> ErrorCode where
F: FnMut(ErrorCode) + Send, Refreshes a local copy of a pool ledger and updates pool nodes connections.
Arguments
handle- pool handle returned by Pool::open_ledgerclosure- the closure that is called when finished
Returns
errorcode- errorcode from calling ffi function. The closure receives the return result
pub fn list() -> Result<String, ErrorCode>[src]
pub fn list() -> Result<String, ErrorCode>Lists names of created pool ledgers
pub fn list_timeout(timeout: Duration) -> Result<String, ErrorCode>[src]
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
pub fn list_async<F: 'static>(closure: F) -> ErrorCode where
F: FnMut(ErrorCode, String) + Send, [src]
pub fn list_async<F: 'static>(closure: F) -> ErrorCode where
F: FnMut(ErrorCode, String) + Send, 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
pub fn close(pool_handle: IndyHandle) -> Result<(), ErrorCode>[src]
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.
pub fn close_timeout(
pool_handle: IndyHandle,
timeout: Duration
) -> Result<(), ErrorCode>[src]
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
pub fn close_async<F: 'static>(pool_handle: IndyHandle, closure: F) -> ErrorCode where
F: FnMut(ErrorCode) + Send, [src]
pub fn close_async<F: 'static>(pool_handle: IndyHandle, closure: F) -> ErrorCode where
F: FnMut(ErrorCode) + Send, Closes opened pool ledger, opened nodes connections and frees allocated resources.
Arguments
handle- pool handle returned by Pool::open_ledger.closure- the closure that is called when finished
Returns
errorcode- errorcode from calling ffi function. The closure receives the return result
pub fn delete(pool_name: &str) -> Result<(), ErrorCode>[src]
pub fn delete(pool_name: &str) -> Result<(), ErrorCode>Deletes created pool ledger configuration.
Arguments
config_name- Name of the pool ledger configuration to delete.
pub fn delete_timeout(
pool_name: &str,
timeout: Duration
) -> Result<(), ErrorCode>[src]
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
pub fn delete_async<F: 'static>(pool_name: &str, closure: F) -> ErrorCode where
F: FnMut(ErrorCode) + Send, [src]
pub fn delete_async<F: 'static>(pool_name: &str, closure: F) -> ErrorCode where
F: FnMut(ErrorCode) + Send, Deletes created pool ledger configuration.
Arguments
config_name- Name of the pool ledger configuration to delete.closure- the closure that is called when finished
Returns
errorcode- errorcode from calling ffi function. The closure receives the return result
pub fn set_protocol_version(protocol_version: usize) -> Result<(), ErrorCode>[src]
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
pub fn set_protocol_version_timeout(
protocol_version: usize,
timeout: Duration
) -> Result<(), ErrorCode>[src]
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
pub fn set_protocol_version_async<F: 'static>(
protocol_version: usize,
closure: F
) -> ErrorCode where
F: FnMut(ErrorCode) + Send, [src]
pub fn set_protocol_version_async<F: 'static>(
protocol_version: usize,
closure: F
) -> ErrorCode where
F: FnMut(ErrorCode) + Send, 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