Skip to content

Commit

Permalink
Add docstrings for rust FFI api
Browse files Browse the repository at this point in the history
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
  • Loading branch information
Patrik-Stas committed Sep 20, 2020
1 parent 6195121 commit 18367a4
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion libvcx/src/api/vcx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@ pub extern fn vcx_init_core(config: *const c_char) -> u32 {
error::SUCCESS.code_num
}

/// Opens pool based on vcx configuration previously set via vcx_init_core
///
/// #Params
/// command_handle: command handle to map callback to user context.
///
/// cb: Callback that provides error status of initialization
///
/// #Returns
/// Error code as a u32
#[no_mangle]
pub extern fn vcx_open_pool(command_handle: CommandHandle, cb: extern fn(xcommand_handle: CommandHandle, err: u32)) -> u32 {
info!("vcx_open_pool >>>");
Expand Down Expand Up @@ -126,6 +135,15 @@ pub extern fn vcx_open_pool(command_handle: CommandHandle, cb: extern fn(xcomman
error::SUCCESS.code_num
}

/// Opens wallet based on vcx configuration previously set via vcx_init_core
///
/// #Params
/// command_handle: command handle to map callback to user context.
///
/// cb: Callback that provides error status of initialization
///
/// #Returns
/// Error code as a u32
#[no_mangle]
pub extern fn vcx_open_wallet(command_handle: CommandHandle, cb: extern fn(xcommand_handle: CommandHandle, err: u32)) -> u32 {
info!("vcx_open_wallet >>>");
Expand Down Expand Up @@ -317,7 +335,7 @@ fn _finish_init(command_handle: CommandHandle, cb: extern fn(xcommand_handle: Co
/// Error code as u32
#[no_mangle]
pub extern fn vcx_init_minimal(config: *const c_char) -> u32 {
// todo: Consider deprecating this, we now have more fine-grained init functions - vcx_init_core, vcx_open_wallet, vcx_open_pool
// todo: Consider deprecating this, we now have more fine-grained init functions - vcx_init_core, vcx_open_wallet, vcx_open_pool
check_useful_c_str!(config,VcxErrorKind::InvalidOption);

trace!("vcx_init_minimal(config: {:?})", config);
Expand Down

0 comments on commit 18367a4

Please sign in to comment.