Struct SocketInfo
pub struct SocketInfo(/* private fields */);net only.Expand description
Connected socket information.
A connection that moves to another path, such as a migrated QUIC connection, updates it
with Self::set_current: every holder reads the current addresses.
Implementations§
§impl SocketInfo
impl SocketInfo
pub fn new(
local_addr: Option<SocketAddress>,
peer_addr: SocketAddress,
) -> SocketInfo
pub fn new( local_addr: Option<SocketAddress>, peer_addr: SocketAddress, ) -> SocketInfo
Create a new SocketInfo.
pub fn local_addr(&self) -> Option<SocketAddress>
pub fn local_addr(&self) -> Option<SocketAddress>
Get the local address of the socket.
pub fn peer_addr(&self) -> SocketAddress
pub fn peer_addr(&self) -> SocketAddress
Get the peer address of the socket.
pub fn address_pair(&self) -> SocketAddresses
pub fn address_pair(&self) -> SocketAddresses
The local and peer address, read together.
pub fn set_current(
&self,
local_addr: Option<SocketAddress>,
peer_addr: SocketAddress,
) -> bool
pub fn set_current( &self, local_addr: Option<SocketAddress>, peer_addr: SocketAddress, ) -> bool
The connection moved to another path. Returns whether its addresses changed.
pub fn ingress(extensions: &Extensions) -> Option<&SocketInfo>
pub fn ingress(extensions: &Extensions) -> Option<&SocketInfo>
The SocketInfo of the connection extensions arrived on, never an outbound
(egress) connection’s, whatever the insertion order.
The nearest ingress view of this store or its parents is resolved first, by the same
rule; otherwise the nearest own SocketInfo. Egress views are never entered.
pub fn egress(extensions: &Extensions) -> Option<&SocketInfo>
pub fn egress(extensions: &Extensions) -> Option<&SocketInfo>
The SocketInfo of the outbound (egress) connection extensions went out on,
never the connection it arrived on, whatever the insertion order.
The nearest egress view of this store or its parents decides: its own nearest egress
view first, by the same rule, else its own SocketInfo. Ingress views are never
entered, and a store without an egress view has none.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SocketInfo
impl !RefUnwindSafe for SocketInfo
impl Send for SocketInfo
impl Sync for SocketInfo
impl Unpin for SocketInfo
impl UnsafeUnpin for SocketInfo
impl UnwindSafe for SocketInfo
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