Struct IcmpErrorReceiver
pub struct IcmpErrorReceiver { /* private fields */ }std and udp only.Expand description
Receives the IcmpErrorReports about datagrams a UdpPacketSocket sent: what the
network answered with ICMP, and what the local stack refused, such as a datagram over the
link MTU.
Created by UdpPacketSocket::icmp_error_receiver. While one exists the socket queues
these reports (Linux IP_RECVERR and IPV6_RECVERR); dropping the last one turns that off
and discards what is still queued. Other platforms have no such queue and refuse to create
one with an io::ErrorKind::Unsupported error.
Queued reports are charged to the socket’s receive buffer: a receiver must keep draining, or arriving datagrams are dropped once that buffer is full.
Reports never reach a datagram receive. Without the queue an ICMP error reaches a connected socket as an error on its next send or receive; with it, such errors on any socket are absorbed instead: a single, batched or coalesced receive returns the datagrams behind the error, and a send that fails with one is retried once, so only an error of its own remains. A receive that absorbs many in a row yields to the scheduler before trying again.
ICMP is not authenticated and is trivially spoofed: a report is a hint about a path, never a reason to change connection state.
Implementations§
§impl IcmpErrorReceiver
impl IcmpErrorReceiver
pub fn poll_recv(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<IcmpErrorReport, DatagramError>>
pub fn poll_recv( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<IcmpErrorReport, DatagramError>>
Receive the next report, or register for readiness.
pub fn recv(
&mut self,
) -> impl Future<Output = Result<IcmpErrorReport, DatagramError>> + Send
pub fn recv( &mut self, ) -> impl Future<Output = Result<IcmpErrorReport, DatagramError>> + Send
Receive the next report.
Trait Implementations§
§impl Debug for IcmpErrorReceiver
impl Debug for IcmpErrorReceiver
§impl Drop for IcmpErrorReceiver
impl Drop for IcmpErrorReceiver
Auto Trait Implementations§
impl !RefUnwindSafe for IcmpErrorReceiver
impl !UnwindSafe for IcmpErrorReceiver
impl Forget for IcmpErrorReceiver
impl Freeze for IcmpErrorReceiver
impl Move for IcmpErrorReceiver
impl Send for IcmpErrorReceiver
impl Sync for IcmpErrorReceiver
impl Unpin for IcmpErrorReceiver
impl UnsafeUnpin for IcmpErrorReceiverwhere
*const ArcInner<PairedSocket> is !null: UnsafeUnpin,
PhantomData<ArcInner<PairedSocket>>: UnsafeUnpin,
*const dyn Future<Output = Result<(), Error>> + Send is !null: UnsafeUnpin,
PhantomData<dyn Future<Output = Result<(), Error>> + Send>: 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