Struct SessionSender
pub struct SessionSender<T> { /* private fields */ }http and std only.Expand description
The sending half of an HttpDatagramSession.
Implementations§
§impl<T> SessionSender<T>where
T: AsyncWrite,
impl<T> SessionSender<T>where
T: AsyncWrite,
pub async fn send_datagram(
&mut self,
payload: Bytes,
) -> Result<DatagramTransport, SessionError>
pub async fn send_datagram( &mut self, payload: Bytes, ) -> Result<DatagramTransport, SessionError>
Send an HTTP Datagram.
With a negotiated native carrier the datagram is handed to it without waiting and may
be lost; a payload above the current native maximum fails with
NativeSendError::TooLarge, and a closed association with
NativeSendError::Closed, rather than silently switching to reliable delivery
(RFC 9297 §3.5). Otherwise it is written as a DATAGRAM capsule, waiting for
data-stream flow control.
pub async fn send_capsule(
&mut self,
ty: CapsuleType,
value: Bytes,
) -> Result<(), SessionError>
pub async fn send_capsule( &mut self, ty: CapsuleType, value: Bytes, ) -> Result<(), SessionError>
Send a complete capsule on the reliable data stream and flush it.
pub async fn start_capsule(
&mut self,
header: CapsuleHeader,
) -> Result<(), SessionError>
pub async fn start_capsule( &mut self, header: CapsuleHeader, ) -> Result<(), SessionError>
Begin forwarding one capsule whose value arrives in chunks through
send_capsule_data.
Until the declared length is supplied, other capsules, capsule-carried datagrams and
close are rejected with SessionError::CapsuleInProgress; native
datagrams are unaffected. Forwarding preserves type, length and value; integers are
re-encoded minimally.
pub async fn send_capsule_data(
&mut self,
chunk: Bytes,
) -> Result<(), SessionError>
pub async fn send_capsule_data( &mut self, chunk: Bytes, ) -> Result<(), SessionError>
Append value bytes to the capsule begun by start_capsule.
A chunk beyond the declared length is rejected with
SessionError::CapsuleLengthMismatch and the capsule stays open.
pub async fn close(&mut self) -> Result<(), SessionError>
pub async fn close(&mut self) -> Result<(), SessionError>
Write any accepted bytes, then finish the data stream cleanly.
Only the local direction ends; receiving continues until the peer ends its own. Once
the end is committed, sends return SessionError::SendClosed and calling close
again resumes finishing the stream.
Trait Implementations§
§impl<T> Debug for SessionSender<T>
impl<T> Debug for SessionSender<T>
§impl<T> Drop for SessionSender<T>
impl<T> Drop for SessionSender<T>
Auto Trait Implementations§
impl<T> !Freeze for SessionSender<T>
impl<T> !RefUnwindSafe for SessionSender<T>
impl<T> !UnwindSafe for SessionSender<T>
impl<T> Send for SessionSender<T>where
SharedIo<T>: Send,
impl<T> Sync for SessionSender<T>where
SharedIo<T>: Sync,
impl<T> Unpin for SessionSender<T>where
SharedIo<T>: Unpin,
impl<T> UnsafeUnpin for SessionSender<T>where
SharedIo<T>: UnsafeUnpin,
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
§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