pub struct StreamCloser { /* private fields */ }Expand description
Ends an incoming stream from outside its reader, for example while another task reads it.
Get one from ByteStreamReader::closer or TextStreamReader::closer.
Implementations§
Source§impl StreamCloser
impl StreamCloser
Sourcepub fn close(&self)
pub fn close(&self)
Ends the stream on the receiving side. The incoming manager drops the stream’s state at
once and reports it closed. A read in progress fails with StreamError::AlreadyClosed
after the chunks that the manager already handed to the reader. Packets of this stream
that the manager has not processed yet are discarded, so a trailer still in its queue does
not merge its attributes.
Does nothing once the stream has ended, and never affects a later stream that reuses its id.
Trait Implementations§
Source§impl Clone for StreamCloser
impl Clone for StreamCloser
Auto Trait Implementations§
impl Freeze for StreamCloser
impl RefUnwindSafe for StreamCloser
impl Send for StreamCloser
impl Sync for StreamCloser
impl Unpin for StreamCloser
impl UnsafeUnpin for StreamCloser
impl UnwindSafe for StreamCloser
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