pub struct SendStream<'a> { /* private fields */ }
Expand description
Access to streams
Implementations§
Source§impl<'a> SendStream<'a>
impl<'a> SendStream<'a>
Sourcepub fn write(&mut self, data: &[u8]) -> Result<usize, WriteError>
pub fn write(&mut self, data: &[u8]) -> Result<usize, WriteError>
Send data on the given stream
Returns the number of bytes successfully written.
Sourcepub fn write_chunks(
&mut self,
data: &mut [Bytes],
) -> Result<Written, WriteError>
pub fn write_chunks( &mut self, data: &mut [Bytes], ) -> Result<Written, WriteError>
Send data on the given stream
Returns the number of bytes and chunks successfully written.
Note that this method might also write a partial chunk. In this case
Written::chunks
will not count this chunk as fully written. However
the chunk will be advanced and contain only non-written data after the call.
Sourcepub fn stopped(&self) -> Result<Option<VarInt>, ClosedStream>
pub fn stopped(&self) -> Result<Option<VarInt>, ClosedStream>
Check if this stream was stopped, get the reason if it was
Sourcepub fn finish(&mut self) -> Result<(), FinishError>
pub fn finish(&mut self) -> Result<(), FinishError>
Finish a send stream, signalling that no more data will be sent.
If this fails, no StreamEvent::Finished
will be generated.
Sourcepub fn set_priority(&mut self, priority: i32) -> Result<(), ClosedStream>
pub fn set_priority(&mut self, priority: i32) -> Result<(), ClosedStream>
Auto Trait Implementations§
impl<'a> Freeze for SendStream<'a>
impl<'a> RefUnwindSafe for SendStream<'a>
impl<'a> Send for SendStream<'a>
impl<'a> Sync for SendStream<'a>
impl<'a> Unpin for SendStream<'a>
impl<'a> !UnwindSafe for SendStream<'a>
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