pub struct ConnectionHandle { /* private fields */ }Expand description
Handle to a connection worker that accepts new channels as channel handles and relays messages.
Implementations§
Source§impl ConnectionHandle
impl ConnectionHandle
Sourcepub async fn open_channel(
&self,
topic: Topic,
init_msg: Vec<u8>,
flags: MsgFlags,
) -> Result<ChannelHandle, Error>
pub async fn open_channel( &self, topic: Topic, init_msg: Vec<u8>, flags: MsgFlags, ) -> Result<ChannelHandle, Error>
Opens a channel by queueing a command and waiting for it to be executed by the worker task.
Sourcepub async fn send_notification(
&self,
topic: Topic,
msg: Vec<u8>,
) -> Result<(), Error>
pub async fn send_notification( &self, topic: Topic, msg: Vec<u8>, ) -> Result<(), Error>
Queues a notification to be sent.
Sourcepub fn has_event(&mut self) -> bool
pub fn has_event(&mut self) -> bool
Returns if there are any events in the queue. This might be an error message.
Sourcepub async fn wait_event(&mut self) -> Result<Option<WorkerEvent>, Error>
pub async fn wait_event(&mut self) -> Result<Option<WorkerEvent>, Error>
Waits for an event, asynchronously.
Sourcepub fn wait_event_blocking(&mut self) -> Result<Option<WorkerEvent>, Error>
pub fn wait_event_blocking(&mut self) -> Result<Option<WorkerEvent>, Error>
Waits for an event, blockingly.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConnectionHandle
impl !RefUnwindSafe for ConnectionHandle
impl Send for ConnectionHandle
impl Sync for ConnectionHandle
impl Unpin for ConnectionHandle
impl !UnwindSafe for ConnectionHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more