Struct SendDatagram
#[non_exhaustive]pub struct SendDatagram<'a> { /* private fields */ }std and udp only.Expand description
Borrowed description of one outgoing datagram or segmented datagram group.
This type contains UDP packet metadata only. It has no connection, packet number, retransmission, or upper-protocol semantics.
Implementations§
§impl<'a> SendDatagram<'a>
impl<'a> SendDatagram<'a>
pub fn new(
destination: impl Into<SocketAddress>,
payload: &'a [u8],
) -> SendDatagram<'a>
pub fn new( destination: impl Into<SocketAddress>, payload: &'a [u8], ) -> SendDatagram<'a>
Construct an ordinary unsegmented datagram.
pub const fn destination(&self) -> SocketAddress
pub const fn destination(&self) -> SocketAddress
Destination address.
pub const fn ecn(&self) -> Option<EcnCodepoint>
pub const fn ecn(&self) -> Option<EcnCodepoint>
Selected ECN codepoint.
pub const fn segment_size(&self) -> Option<NonZero<usize>>
pub const fn segment_size(&self) -> Option<NonZero<usize>>
Configured segment size.
pub fn maybe_with_ecn(self, ecn: Option<EcnCodepoint>) -> SendDatagram<'a>
pub fn maybe_with_ecn(self, ecn: Option<EcnCodepoint>) -> SendDatagram<'a>
Set the ECN codepoint, or clear it to retain the socket default.
pub fn maybe_set_ecn(
&mut self,
ecn: Option<EcnCodepoint>,
) -> &mut SendDatagram<'a>
pub fn maybe_set_ecn( &mut self, ecn: Option<EcnCodepoint>, ) -> &mut SendDatagram<'a>
Set the ECN codepoint, or clear it to retain the socket default.
pub fn with_ecn(self, ecn: EcnCodepoint) -> SendDatagram<'a>
pub fn with_ecn(self, ecn: EcnCodepoint) -> SendDatagram<'a>
Set the ECN codepoint, or clear it to retain the socket default.
pub fn set_ecn(&mut self, ecn: EcnCodepoint) -> &mut SendDatagram<'a>
pub fn set_ecn(&mut self, ecn: EcnCodepoint) -> &mut SendDatagram<'a>
Set the ECN codepoint, or clear it to retain the socket default.
pub fn without_ecn(self) -> SendDatagram<'a>
pub fn without_ecn(self) -> SendDatagram<'a>
Set the ECN codepoint, or clear it to retain the socket default.
pub fn unset_ecn(&mut self) -> &mut SendDatagram<'a>
pub fn unset_ecn(&mut self) -> &mut SendDatagram<'a>
Set the ECN codepoint, or clear it to retain the socket default.
pub fn maybe_with_source_ip(self, source_ip: Option<IpAddr>) -> SendDatagram<'a>
pub fn maybe_with_source_ip(self, source_ip: Option<IpAddr>) -> SendDatagram<'a>
Select the outgoing source IP.
pub fn maybe_set_source_ip(
&mut self,
source_ip: Option<IpAddr>,
) -> &mut SendDatagram<'a>
pub fn maybe_set_source_ip( &mut self, source_ip: Option<IpAddr>, ) -> &mut SendDatagram<'a>
Select the outgoing source IP.
pub fn with_source_ip(self, source_ip: IpAddr) -> SendDatagram<'a>
pub fn with_source_ip(self, source_ip: IpAddr) -> SendDatagram<'a>
Select the outgoing source IP.
pub fn set_source_ip(&mut self, source_ip: IpAddr) -> &mut SendDatagram<'a>
pub fn set_source_ip(&mut self, source_ip: IpAddr) -> &mut SendDatagram<'a>
Select the outgoing source IP.
pub fn without_source_ip(self) -> SendDatagram<'a>
pub fn without_source_ip(self) -> SendDatagram<'a>
Select the outgoing source IP.
pub fn unset_source_ip(&mut self) -> &mut SendDatagram<'a>
pub fn unset_source_ip(&mut self) -> &mut SendDatagram<'a>
Select the outgoing source IP.
pub fn maybe_with_segment_size(
self,
segment_size: Option<NonZero<usize>>,
) -> SendDatagram<'a>
pub fn maybe_with_segment_size( self, segment_size: Option<NonZero<usize>>, ) -> SendDatagram<'a>
Describe concatenated datagrams for a segmented send.
The size must be smaller than the payload length. Callers adapting descriptors from another API must omit a one-segment value equal to the payload length.
pub fn maybe_set_segment_size(
&mut self,
segment_size: Option<NonZero<usize>>,
) -> &mut SendDatagram<'a>
pub fn maybe_set_segment_size( &mut self, segment_size: Option<NonZero<usize>>, ) -> &mut SendDatagram<'a>
Describe concatenated datagrams for a segmented send.
The size must be smaller than the payload length. Callers adapting descriptors from another API must omit a one-segment value equal to the payload length.
pub fn with_segment_size(self, segment_size: NonZero<usize>) -> SendDatagram<'a>
pub fn with_segment_size(self, segment_size: NonZero<usize>) -> SendDatagram<'a>
Describe concatenated datagrams for a segmented send.
The size must be smaller than the payload length. Callers adapting descriptors from another API must omit a one-segment value equal to the payload length.
pub fn set_segment_size(
&mut self,
segment_size: NonZero<usize>,
) -> &mut SendDatagram<'a>
pub fn set_segment_size( &mut self, segment_size: NonZero<usize>, ) -> &mut SendDatagram<'a>
Describe concatenated datagrams for a segmented send.
The size must be smaller than the payload length. Callers adapting descriptors from another API must omit a one-segment value equal to the payload length.
pub fn without_segment_size(self) -> SendDatagram<'a>
pub fn without_segment_size(self) -> SendDatagram<'a>
Describe concatenated datagrams for a segmented send.
The size must be smaller than the payload length. Callers adapting descriptors from another API must omit a one-segment value equal to the payload length.
pub fn unset_segment_size(&mut self) -> &mut SendDatagram<'a>
pub fn unset_segment_size(&mut self) -> &mut SendDatagram<'a>
Describe concatenated datagrams for a segmented send.
The size must be smaller than the payload length. Callers adapting descriptors from another API must omit a one-segment value equal to the payload length.
pub fn segment_count(self) -> usize
pub fn segment_count(self) -> usize
Number of UDP datagrams represented by this descriptor.
Trait Implementations§
§impl<'a> Clone for SendDatagram<'a>
impl<'a> Clone for SendDatagram<'a>
§fn clone(&self) -> SendDatagram<'a>
fn clone(&self) -> SendDatagram<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for SendDatagram<'a>
Auto Trait Implementations§
impl<'a> Freeze for SendDatagram<'a>
impl<'a> RefUnwindSafe for SendDatagram<'a>
impl<'a> Send for SendDatagram<'a>
impl<'a> Sync for SendDatagram<'a>
impl<'a> Unpin for SendDatagram<'a>
impl<'a> UnsafeUnpin for SendDatagram<'a>
impl<'a> UnwindSafe for SendDatagram<'a>
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