pub struct MessageWriter<W: AsyncWrite + Unpin + Send> { /* private fields */ }Expand description
Writer half of a JSON-RPC connection, serialized so multiple tasks can send.
Implementations§
Source§impl<W: AsyncWrite + Unpin + Send> MessageWriter<W>
impl<W: AsyncWrite + Unpin + Send> MessageWriter<W>
Sourcepub async fn write_message(&self, message: &Message) -> Result<(), FramingError>
pub async fn write_message(&self, message: &Message) -> Result<(), FramingError>
Write a single Content-Length-framed message.
§Errors
Returns FramingError::Io on writer failure or
FramingError::BadJson if the message cannot be serialized.
Auto Trait Implementations§
impl<W> !Freeze for MessageWriter<W>
impl<W> !RefUnwindSafe for MessageWriter<W>
impl<W> Send for MessageWriter<W>
impl<W> Sync for MessageWriter<W>
impl<W> Unpin for MessageWriter<W>
impl<W> UnsafeUnpin for MessageWriter<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for MessageWriter<W>where
W: UnwindSafe,
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