[−][src]Struct holochain_net_ipc::ipc_client::IpcClient
IPC communication client structure. Allows connection to an external process that manages p2p communications.
This struct takes an abstract socket type mainly to facilitate unit testing. You will mainly instantiate the exported ZmqIpcClient type definition.
Methods
impl<S: IpcSocket> IpcClient<S>
[src]
impl<S: IpcSocket> IpcClient<S>
pub fn destroy_context() -> Result<()>
[src]
pub fn destroy_context() -> Result<()>
Perform any underlying socket library cleanup. Call this before your application exits.
pub fn new() -> Result<Self>
[src]
pub fn new() -> Result<Self>
Get a new IpcClient instance.
pub fn close(self) -> Result<()>
[src]
pub fn close(self) -> Result<()>
Close this specific IpcClient connection.
pub fn connect(&mut self, endpoint: &str) -> Result<()>
[src]
pub fn connect(&mut self, endpoint: &str) -> Result<()>
Connect this IpcClient to a p2p ipc server.
pub fn ping(&mut self) -> Result<()>
[src]
pub fn ping(&mut self) -> Result<()>
Send a heartbeat message to the ipc server.
pub fn call(&mut self, data: &[u8], cb: Option<CallResult>) -> Result<()>
[src]
pub fn call(&mut self, data: &[u8], cb: Option<CallResult>) -> Result<()>
invoke an RPC-style call
on the ipc server
pub fn respond(&mut self, message_id: &[u8], data: Result<&[u8]>) -> Result<()>
[src]
pub fn respond(&mut self, message_id: &[u8], data: Result<&[u8]>) -> Result<()>
respond to a remote call
pub fn process(&mut self, millis: i64) -> Result<Option<Message>>
[src]
pub fn process(&mut self, millis: i64) -> Result<Option<Message>>
Allow IPC client to do any needed processing. This should be called regularly to make sure any maintenance tasks are executed properly, and to avoid incoming data backing up in memory.
If there are no incoming messages waiting in the queue, millis
indicates how long we should block waiting for one. It is perfectly valid to pass in 0
for millis
.
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,