Pool

Struct Pool 

Source
pub struct Pool {}

Implementations§

Source§

impl Pool

Source

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. }
Source

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
Source

pub fn create_ledger_config_async<F>( pool_name: &str, pool_config: Option<&str>, closure: F, ) -> ErrorCode
where F: FnMut(ErrorCode) + Send + 'static,

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
Source

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.

Source

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.

Source

pub fn open_ledger_async<F>( pool_name: &str, config: Option<&str>, closure: F, ) -> ErrorCode
where F: FnMut(ErrorCode, IndyHandle) + Send + 'static,

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
Source

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
Source

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_ledger
  • timeout - the maximum time this function waits for a response
Source

pub fn refresh_async<F>(pool_handle: IndyHandle, closure: F) -> ErrorCode
where F: FnMut(ErrorCode) + Send + 'static,

Refreshes a local copy of a pool ledger and updates pool nodes connections.

§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
Source

pub fn list() -> Result<String, ErrorCode>

Lists names of created pool ledgers

Source

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
Source

pub fn list_async<F>(closure: F) -> ErrorCode
where F: FnMut(ErrorCode, String) + Send + 'static,

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
Source

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.
Source

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
Source

pub fn close_async<F>(pool_handle: IndyHandle, closure: F) -> ErrorCode
where F: FnMut(ErrorCode) + Send + 'static,

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
Source

pub fn delete(pool_name: &str) -> Result<(), ErrorCode>

Deletes created pool ledger configuration.

§Arguments
  • config_name - Name of the pool ledger configuration to delete.
Source

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
Source

pub fn delete_async<F>(pool_name: &str, closure: F) -> ErrorCode
where F: FnMut(ErrorCode) + Send + 'static,

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
Source

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
Source

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.4
  • timeout - the maximum time this function waits for a response
Source

pub fn set_protocol_version_async<F>( protocol_version: usize, closure: F, ) -> ErrorCode
where F: FnMut(ErrorCode) + Send + 'static,

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
  • closure - the closure that is called when finished
§Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Auto Trait Implementations§

§

impl Freeze for Pool

§

impl RefUnwindSafe for Pool

§

impl Send for Pool

§

impl Sync for Pool

§

impl Unpin for Pool

§

impl UnwindSafe for Pool

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.