pub struct Endpoint {
pub owner: ProcessId,
/* private fields */
}Expand description
IPC endpoint for bidirectional communication
Fields§
§owner: ProcessIdOwner process ID
Implementations§
Source§impl Endpoint
impl Endpoint
Sourcepub fn new_with_guard(owner: ProcessId) -> (Self, ChannelGuard)
pub fn new_with_guard(owner: ProcessId) -> (Self, ChannelGuard)
Create a new endpoint with RAII guard
Sourcepub fn send_sync(&self, msg: Message, _sender: ProcessId) -> Result<()>
pub fn send_sync(&self, msg: Message, _sender: ProcessId) -> Result<()>
Send a message through this endpoint (synchronous)
Sourcepub fn receive_sync(&self, receiver: ProcessId) -> Result<Message>
pub fn receive_sync(&self, receiver: ProcessId) -> Result<Message>
Receive a message from this endpoint (synchronous)
Sourcepub fn send_async(&self, msg: Message) -> Result<()>
pub fn send_async(&self, msg: Message) -> Result<()>
Send without blocking
Sourcepub fn try_receive(&self) -> Result<Message>
pub fn try_receive(&self) -> Result<Message>
Try to receive without blocking