CMD 服务端第一入口
owner_single_use
/// Instantiate wallet Owner API for a single-use (command line) call
/// Return a function containing a loaded API context to call
foreign_single_use
/// Instantiate wallet Foreign API for a single-use (command line) call
/// Return a function containing a loaded API context to call
owner_listener
/// Listener version, providing same API but listening for requests on a
/// port and wrapping the calls
foreign_listener
/// Listener version, providing same API but listening for requests on a
/// port and wrapping the calls
钱包 CMD 和 软件 CMD 启动的时候,会对应的调用它们,以监听并进行事件处理。
OwnerAPIHandler
/// API Handler/Wrapper for owner functions
pub struct OwnerAPIHandler<T: ?Sized, C, K>
where
T: WalletBackend<C, K> + Send + Sync + 'static,
C: WalletClient + 'static,
K: Keychain + 'static,
{
/// Wallet instance
pub wallet: Arc<Mutex<Box<T>>>,
phantom: PhantomData<K>,
phantom_c: PhantomData<C>,
}
ForeignAPIHandler
/// API Handler/Wrapper for foreign functions
pub struct ForeignAPIHandler<T: ?Sized, C, K>
where
T: WalletBackend<C, K> + Send + Sync + 'static,
C: WalletClient + 'static,
K: Keychain + 'static,
{
/// Wallet instance
pub wallet: Arc<Mutex<Box<T>>>,
phantom: PhantomData<K>,
phantom_c: PhantomData<C>,
}