Struct DatagramCapabilities
#[non_exhaustive]pub struct DatagramCapabilities {Show 15 fields
pub max_payload_ipv4: usize,
pub max_payload_ipv6: usize,
pub max_receive_batch: usize,
pub max_send_batch: usize,
pub max_send_segments: usize,
pub max_receive_segments: usize,
pub may_fragment: bool,
pub send_ecn: bool,
pub receive_ecn: bool,
pub send_source_ip: bool,
pub receive_local_ip: bool,
pub receive_interface: bool,
pub receive_original_destination: bool,
pub receive_timestamp: bool,
pub receive_truncation: bool,
}std and udp only.Expand description
UDP implementation and ancillary-I/O capabilities of a socket.
This is a snapshot. A backend can lower an offload limit after the kernel or driver rejects an attempted operation, so callers should query capabilities again after an offload error. A segmented send is atomic from this API’s perspective: implementations never hide such a rejection by splitting it into several ordinary sends.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_payload_ipv4: usizeMaximum unsegmented IPv4 UDP payload accepted by this implementation.
max_payload_ipv6: usizeMaximum unsegmented IPv6 UDP payload accepted by this implementation.
max_receive_batch: usizeMaximum receive entries that can be filled by one optimized operation.
max_send_batch: usizeMaximum send entries that can be attempted by one optimized operation.
max_send_segments: usizeMaximum datagrams represented by one segmented send descriptor.
This is the authoritative validation limit. It can be backed by native offload or by an implementation such as the deterministic test socket.
max_receive_segments: usizeMaximum datagrams represented by one receive buffer.
This is the authoritative coalesced-entry limit, regardless of how the implementation produces such entries.
may_fragment: boolWhether outgoing IP packets might be fragmented by the network stack.
This says only whether the socket backend successfully enabled a don’t-fragment policy. It is not a path MTU estimate.
send_ecn: boolWhether outgoing ECN selection is supported.
receive_ecn: boolWhether received ECN codepoints are reported.
send_source_ip: boolWhether an outgoing source IP can be selected per datagram.
receive_local_ip: boolWhether the effective local destination IP is reported per datagram.
receive_interface: boolWhether the incoming interface index is reported.
receive_original_destination: boolWhether transparent-proxy original destinations are reported.
receive_timestamp: boolWhether receive timestamps are reported.
receive_truncation: boolWhether receive truncation is detected instead of silently discarded.
Implementations§
§impl DatagramCapabilities
impl DatagramCapabilities
pub const fn max_payload_for(self, address: SocketAddress) -> usize
pub const fn max_payload_for(self, address: SocketAddress) -> usize
Return the implementation payload ceiling for address’s IP family.
pub const fn supports(self, feature: DatagramFeature) -> bool
pub const fn supports(self, feature: DatagramFeature) -> bool
Whether this snapshot provides feature.
pub const fn portable() -> DatagramCapabilities
pub const fn portable() -> DatagramCapabilities
Conservative capabilities for a portable one-packet fallback.
Trait Implementations§
§impl Clone for DatagramCapabilities
impl Clone for DatagramCapabilities
§fn clone(&self) -> DatagramCapabilities
fn clone(&self) -> DatagramCapabilities
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DatagramCapabilities
§impl Debug for DatagramCapabilities
impl Debug for DatagramCapabilities
§impl Default for DatagramCapabilities
impl Default for DatagramCapabilities
§fn default() -> DatagramCapabilities
fn default() -> DatagramCapabilities
impl Eq for DatagramCapabilities
§impl PartialEq for DatagramCapabilities
impl PartialEq for DatagramCapabilities
impl StructuralPartialEq for DatagramCapabilities
Auto Trait Implementations§
impl Freeze for DatagramCapabilities
impl RefUnwindSafe for DatagramCapabilities
impl Send for DatagramCapabilities
impl Sync for DatagramCapabilities
impl Unpin for DatagramCapabilities
impl UnsafeUnpin for DatagramCapabilities
impl UnwindSafe for DatagramCapabilities
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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