Struct StreamHandle
pub struct StreamHandle { /* private fields */ }quic and std only.Expand description
Cloneable handle to a stream, independent of its I/O owner: aborts the stream (resets sending and, for bidirectional streams, stops receiving) and sends datagrams bound to it. Dropping the handle has no effect on the stream.
Implementations§
§impl StreamHandle
impl StreamHandle
pub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
pub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Queue a connection datagram bound to this stream, dropping the oldest queued ones for
space (see Connection::send_datagram).
The stream’s send side is checked under the lock that queues the datagram: once it is
finished (even before the FIN is acknowledged), reset, stopped by the peer or lost, this
returns SendDatagramError::StreamClosed (RFC 9297 §2.1). It never polls the stream.
FIN waits until previously queued datagrams for this stream leave the local send
queue through transmission or a permitted drop. Network delivery remains unreliable.
pub fn try_send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
pub fn try_send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
As send_datagram, but a full send buffer returns
SendDatagramError::Blocked instead of dropping queued datagrams.
Trait Implementations§
§impl Clone for StreamHandle
impl Clone for StreamHandle
§fn clone(&self) -> StreamHandle
fn clone(&self) -> StreamHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for StreamHandle
impl Debug for StreamHandle
§impl StreamHandle for StreamHandle
impl StreamHandle for StreamHandle
§fn abort(&self, error_code: VarInt)
fn abort(&self, error_code: VarInt)
§fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
§fn try_send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
fn try_send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>
Self::send_datagram, but a full send buffer fails instead.Auto Trait Implementations§
impl !RefUnwindSafe for StreamHandle
impl !UnwindSafe for StreamHandle
impl Forget for StreamHandle
impl Freeze for StreamHandle
impl Move for StreamHandle
impl Send for StreamHandle
impl Sync for StreamHandle
impl Unpin for StreamHandle
impl UnsafeUnpin for StreamHandle
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more