Trait runa_io_traits::WriteMessage
source · pub trait WriteMessage {
// Required methods
fn poll_ready(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<()>>;
fn start_send<M: Serialize + Debug>(
self: Pin<&mut Self>,
object_id: u32,
msg: M
);
fn poll_flush(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<()>>;
// Provided methods
fn send<'a, 'b, 'c, M: Serialize + Unpin + Debug + 'b>(
&'a mut self,
object_id: u32,
msg: M
) -> Send<'c, Self, M> ⓘ
where Self: Unpin,
'a: 'c,
'b: 'c { ... }
fn flush(&mut self) -> Flush<'_, Self> ⓘ
where Self: Unpin { ... }
}Expand description
A trait for objects that can accept messages to be sent.
This is similar to Sink, but instead of accepting only one type of
Items, it accepts any type that implements
Serialize.
Required Methods§
sourcefn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
Reserve space for a message