Struct PrefixedDatagramSocket
pub struct PrefixedDatagramSocket<S> { /* private fields */ }Available on crate features
std and udp only.Expand description
A DatagramSocket that first yields the datagrams an inspection read ahead, in order and
with their boundaries and metadata, and only then what inner receives.
Sending goes straight to inner.
Implementations§
§impl<S> PrefixedDatagramSocket<S>
impl<S> PrefixedDatagramSocket<S>
pub fn new(
inner: S,
prefix: impl IntoIterator<Item = RetainedDatagram>,
) -> PrefixedDatagramSocket<S>
pub fn new( inner: S, prefix: impl IntoIterator<Item = RetainedDatagram>, ) -> PrefixedDatagramSocket<S>
Replay prefix before anything inner receives later.
pub fn retained(&self) -> &VecDeque<RetainedDatagram>
pub fn retained(&self) -> &VecDeque<RetainedDatagram>
The datagrams not yet received from this socket.
Trait Implementations§
§impl<S> DatagramSocket for PrefixedDatagramSocket<S>where
S: DatagramSocket,
impl<S> DatagramSocket for PrefixedDatagramSocket<S>where
S: DatagramSocket,
§type Sender = <S as DatagramSocket>::Sender
type Sender = <S as DatagramSocket>::Sender
Independently wakeable send handle created by this socket.
§fn create_sender(&self) -> <PrefixedDatagramSocket<S> as DatagramSocket>::Sender
fn create_sender(&self) -> <PrefixedDatagramSocket<S> as DatagramSocket>::Sender
Create a send handle with independent readiness registration. Read more
§fn poll_recv(
&mut self,
cx: &mut Context<'_>,
buffers: &mut [IoSliceMut<'_>],
metadata: &mut [DatagramMetadata],
) -> Poll<Result<usize, DatagramError>>
fn poll_recv( &mut self, cx: &mut Context<'_>, buffers: &mut [IoSliceMut<'_>], metadata: &mut [DatagramMetadata], ) -> Poll<Result<usize, DatagramError>>
Receive one or more datagrams, or register for readiness. Read more
§fn capabilities(&self) -> DatagramCapabilities
fn capabilities(&self) -> DatagramCapabilities
Current runtime-detected capabilities.
§impl<S> Debug for PrefixedDatagramSocket<S>where
S: Debug,
impl<S> Debug for PrefixedDatagramSocket<S>where
S: Debug,
§impl<S> ExtensionsRef for PrefixedDatagramSocket<S>where
S: ExtensionsRef,
impl<S> ExtensionsRef for PrefixedDatagramSocket<S>where
S: ExtensionsRef,
§fn extensions(&self) -> &Extensions
fn extensions(&self) -> &Extensions
Get reference to the underlying
Extensions store§impl<S> Socket for PrefixedDatagramSocket<S>where
S: Socket,
impl<S> Socket for PrefixedDatagramSocket<S>where
S: Socket,
§fn local_addr(&self) -> Result<SocketAddress, Error>
fn local_addr(&self) -> Result<SocketAddress, Error>
Try to get the local address of the socket.
§fn peer_addr(&self) -> Result<SocketAddress, Error>
fn peer_addr(&self) -> Result<SocketAddress, Error>
Try to get the remote address of the socket.
Auto Trait Implementations§
impl<S> Freeze for PrefixedDatagramSocket<S>where
S: Freeze,
impl<S> RefUnwindSafe for PrefixedDatagramSocket<S>where
S: RefUnwindSafe,
impl<S> Send for PrefixedDatagramSocket<S>where
S: Send,
impl<S> Sync for PrefixedDatagramSocket<S>where
S: Sync,
impl<S> Unpin for PrefixedDatagramSocket<S>where
S: Unpin,
impl<S> UnsafeUnpin for PrefixedDatagramSocket<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for PrefixedDatagramSocket<S>where
S: UnwindSafe,
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<S> DatagramBridgeInput for S
impl<S> DatagramBridgeInput for S
§fn ingress(&self) -> &<S as DatagramBridgeInput>::Ingress
fn ingress(&self) -> &<S as DatagramBridgeInput>::Ingress
The ingress socket the egress is created for.
§fn bridge<Egress>(
self,
egress: Egress,
) -> <S as DatagramBridgeInput>::Bridged<Egress>where
Egress: Send + 'static,
fn bridge<Egress>(
self,
egress: Egress,
) -> <S as DatagramBridgeInput>::Bridged<Egress>where
Egress: Send + 'static,
This input with
egress next to its ingress.§impl<S> DatagramPeekInput for Swhere
S: DatagramSocket,
impl<S> DatagramPeekInput for Swhere
S: DatagramSocket,
§type Mapped<Peeked: DatagramSocket> = Peeked
type Mapped<Peeked: DatagramSocket> = Peeked
This input with its peeked socket replaced, usually by a
PrefixedDatagramSocket.§fn peek_socket_mut(&mut self) -> &mut <S as DatagramPeekInput>::Socket
fn peek_socket_mut(&mut self) -> &mut <S as DatagramPeekInput>::Socket
The socket an inspection reads from.
§fn map_peek_socket<Peeked, F>(
self,
map: F,
) -> <S as DatagramPeekInput>::Mapped<Peeked>
fn map_peek_socket<Peeked, F>( self, map: F, ) -> <S as DatagramPeekInput>::Mapped<Peeked>
Rebuild this input around
map’s result for its peeked socket.§impl<T> DatagramSocketExt for Twhere
T: DatagramSocket + ?Sized,
impl<T> DatagramSocketExt for Twhere
T: DatagramSocket + ?Sized,
§fn recv<'a>(
&'a mut self,
buffer: &'a mut [u8],
) -> impl Future<Output = Result<DatagramMetadata, DatagramError>> + Send + 'awhere
Self: Sized,
fn recv<'a>(
&'a mut self,
buffer: &'a mut [u8],
) -> impl Future<Output = Result<DatagramMetadata, DatagramError>> + Send + 'awhere
Self: Sized,
Receive one datagram into
buffer.§fn recv_batch<'a, 'buffer>(
&'a mut self,
buffers: &'a mut [IoSliceMut<'buffer>],
metadata: &'a mut [DatagramMetadata],
) -> impl Future<Output = Result<usize, DatagramError>> + Send + 'awhere
'buffer: 'a,
Self: Sized,
fn recv_batch<'a, 'buffer>(
&'a mut self,
buffers: &'a mut [IoSliceMut<'buffer>],
metadata: &'a mut [DatagramMetadata],
) -> impl Future<Output = Result<usize, DatagramError>> + Send + 'awhere
'buffer: 'a,
Self: Sized,
Receive one or more datagrams into parallel buffer and metadata slices.
§impl<T> ForwardedClientExt for Twhere
T: ExtensionsRef + ?Sized,
impl<T> ForwardedClientExt for Twhere
T: ExtensionsRef + ?Sized,
§fn forwarded_client(&self) -> Option<&ForwardedElement>
fn forwarded_client(&self) -> Option<&ForwardedElement>
The element describing the client.
§fn forwarded_client_ip(&self) -> Option<IpAddr>
fn forwarded_client_ip(&self) -> Option<IpAddr>
The client’s IP, from its
for node.§fn forwarded_client_socket_addr(&self) -> Option<SocketAddress>
fn forwarded_client_socket_addr(&self) -> Option<SocketAddress>
The client’s IP and port, from its
for node.§fn forwarded_client_host(&self) -> Option<&ForwardedAuthority>
fn forwarded_client_host(&self) -> Option<&ForwardedAuthority>
The host the client asked for.
§fn forwarded_client_proto(&self) -> Option<ForwardedProtocol>
fn forwarded_client_proto(&self) -> Option<ForwardedProtocol>
The protocol the client used.
§fn forwarded_client_version(&self) -> Option<ForwardedVersion>
fn forwarded_client_version(&self) -> Option<ForwardedVersion>
The HTTP version the client used.
§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> ⓘ
Converts
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> ⓘ
Converts
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>
Wrap the input message
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>
Create a new
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more