Struct web_transport::SendStream
source · pub struct SendStream(/* private fields */);
Expand description
An outgoing stream of bytes to the peer.
QUIC streams have flow control, which means the send rate is limited by the peer’s receive window. The stream will be closed with a graceful FIN when dropped.
Implementations§
source§impl SendStream
impl SendStream
sourcepub async fn write(&mut self, buf: &[u8]) -> Result<usize, WriteError>
pub async fn write(&mut self, buf: &[u8]) -> Result<usize, WriteError>
Write some of the buffer to the stream, potentailly blocking on flow control.
sourcepub async fn write_buf<B: Buf>(
&mut self,
buf: &mut B,
) -> Result<usize, WriteError>
pub async fn write_buf<B: Buf>( &mut self, buf: &mut B, ) -> Result<usize, WriteError>
Write some of the given buffer to the stream, potentially blocking on flow control.
sourcepub async fn write_chunk(&mut self, buf: Bytes) -> Result<(), WriteError>
pub async fn write_chunk(&mut self, buf: Bytes) -> Result<(), WriteError>
Write the entire chunk of bytes to the stream.
More efficient for some implementations, as it avoids a copy
sourcepub fn set_priority(&mut self, order: i32)
pub fn set_priority(&mut self, order: i32)
Set the stream’s priority.
Streams with lower values will be sent first, but are not guaranteed to arrive first.
Auto Trait Implementations§
impl Freeze for SendStream
impl RefUnwindSafe for SendStream
impl Send for SendStream
impl Sync for SendStream
impl Unpin for SendStream
impl UnwindSafe for SendStream
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