pub struct Writer<S: SendStream> { /* private fields */ }Implementations§
Source§impl<S: SendStream> Writer<S>
impl<S: SendStream> Writer<S>
pub fn new(stream: S) -> Self
pub async fn encode<T: Encode>(&mut self, msg: &T) -> Result<(), Error>
pub async fn write_all<Buf: Buf + Send>( &mut self, buf: &mut Buf, ) -> Result<(), Error>
Sourcepub async fn finish(&mut self) -> Result<(), Error>
pub async fn finish(&mut self) -> Result<(), Error>
A clean termination of the stream, waiting for the peer to close.
pub fn abort(&mut self, err: &Error)
pub async fn closed(&mut self) -> Result<(), Error>
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for Writer<S>where
S: Freeze,
impl<S> RefUnwindSafe for Writer<S>where
S: RefUnwindSafe,
impl<S> Send for Writer<S>
impl<S> Sync for Writer<S>where
S: Sync,
impl<S> Unpin for Writer<S>where
S: Unpin,
impl<S> UnwindSafe for Writer<S>where
S: 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