pub struct CallbackTransport { /* private fields */ }Expand description
A transport whose every operation is a host callback.
Built by pamoja_transport_from_callbacks and held inside a
PamojaTransport, so it composes wherever a transport does.
Trait Implementations§
Source§impl Drop for CallbackTransport
impl Drop for CallbackTransport
Source§impl Receive for CallbackTransport
impl Receive for CallbackTransport
Source§async fn recv(&mut self) -> Result<Option<Message>>
async fn recv(&mut self) -> Result<Option<Message>>
Awaits the next message the host delivered.
§Returns
Some(message) for the next queued message; None once the host reported
the link ended or after a failure was reported, or at once for a host with
no recv.
§Errors
Returns [Error::Closed] if the transport is not connected, and once the
failure the host’s recv reported, after which it is called no more until
the next connect.
Source§impl Transport for CallbackTransport
impl Transport for CallbackTransport
Source§async fn connect(&mut self) -> Result<()>
async fn connect(&mut self) -> Result<()>
Establishes the connection to the broker, peer, or bus. Read more
Source§async fn send(&mut self, topic: &str, payload: &[u8]) -> Result<()>
async fn send(&mut self, topic: &str, payload: &[u8]) -> Result<()>
Publishes a payload to a topic. Read more
Auto Trait Implementations§
impl Freeze for CallbackTransport
impl RefUnwindSafe for CallbackTransport
impl Send for CallbackTransport
impl Sync for CallbackTransport
impl Unpin for CallbackTransport
impl UnsafeUnpin for CallbackTransport
impl UnwindSafe for CallbackTransport
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