indy_sys/
lib.rs

1extern crate libc;
2
3pub mod anoncreds;
4pub mod blob_storage;
5pub mod crypto;
6pub mod did;
7pub mod ledger;
8pub mod non_secrets;
9pub mod pairwise;
10pub mod payments;
11pub mod pool;
12pub mod wallet;
13pub mod logger;
14pub mod cache;
15pub mod metrics;
16
17extern crate serde;
18
19#[macro_use]
20extern crate serde_derive;
21
22use self::libc::{c_void, c_char};
23
24pub type CVoid = c_void;
25pub type BString = *const u8;
26pub type CString = *const c_char;
27
28#[repr(transparent)]
29#[derive(Debug, Hash, PartialEq, Eq, Copy, Clone, Serialize, Deserialize)]
30pub struct WalletHandle(pub i32);
31pub const INVALID_WALLET_HANDLE : WalletHandle = WalletHandle(0);
32
33pub type PoolHandle = i32;
34pub const INVALID_POOL_HANDLE : PoolHandle = 0;
35
36pub type CommandHandle = i32;
37pub const INVALID_COMMAND_HANDLE : CommandHandle = 0;
38
39//pub type Handle = i32;
40pub type IndyHandle = i32;
41pub type SearchHandle = i32;
42pub type RecordHandle = i32;
43pub type TailWriterHandle = i32;
44pub type StorageHandle = i32;
45pub type BlobStorageReaderHandle = i32;
46pub type BlobStorageReaderCfgHandle = i32;
47pub type MetadataHandle = i32;
48pub type Timeout = i32;
49pub type TailsWriterHandle = i32;
50
51pub type Error = i32;
52
53pub type ResponseEmptyCB = extern fn(xcommand_handle: CommandHandle, err: Error);
54pub type ResponseBoolCB = extern fn(xcommand_handle: CommandHandle, err: Error, bool1: bool);
55pub type ResponseI32CB = extern fn(xcommand_handle: CommandHandle, err: Error, handle: IndyHandle);
56pub type ResponseWalletHandleCB = extern fn(xcommand_handle: CommandHandle, err: Error, handle: WalletHandle);
57pub type ResponseI32UsizeCB = extern fn(xcommand_handle: CommandHandle, err: Error, handle: IndyHandle, total_count: usize);
58pub type ResponseStringCB = extern fn(xcommand_handle: CommandHandle, err: Error, str1: CString);
59pub type ResponseStringStringCB = extern fn(xcommand_handle: CommandHandle, err: Error, str1: CString, str2: CString);
60pub type ResponseStringStringStringCB = extern fn(xcommand_handle: CommandHandle, err: Error, str1: CString, str2: CString, str3: CString);
61pub type ResponseSliceCB = extern fn(xcommand_handle: CommandHandle, err: Error, raw: BString, len: u32);
62pub type ResponseStringSliceCB = extern fn(xcommand_handle: CommandHandle, err: Error, str1: CString, raw: BString, len: u32);
63pub type ResponseStringStringU64CB = extern fn(xcommand_handle: CommandHandle, err: Error, arg1: CString, arg2: CString, arg3: u64);
64pub type ResponseStringI64CB = extern fn(xcommand_handle: CommandHandle, err: Error, arg1: CString, arg3: i64);
65
66extern {
67    #[no_mangle]
68    pub fn indy_set_runtime_config(config: CString) -> Error;
69
70    #[no_mangle]
71    pub fn indy_get_current_error(error_json_p: *mut CString);
72}