Struct PrivateIpNetMatcher
pub struct PrivateIpNetMatcher { /* private fields */ }Expand description
Matcher based on the ip part of the SocketAddr of the peer,
matching only if the IP is considered a private address.
Whether or not an address is considered private is determined by the following RFCs:
- RFC 1918: Address Allocation for Private Internets (IPv4)
- RFC 4193: Unique Local IPv6 Unicast Addresses
- RFC 3927: Dynamic Configuration of IPv4 Link-Local Addresses
- RFC 4291: IP Version 6 Addressing Architecture
- RFC 1122: Requirements for Internet Hosts – Communication Layers
- RFC 6890: Special-Purpose IP Address Registries
- RFC rfc6598: IANA-Reserved IPv4 Prefix for Shared Address Space
Implementations§
§impl PrivateIpNetMatcher
impl PrivateIpNetMatcher
pub fn new() -> PrivateIpNetMatcher
pub fn new() -> PrivateIpNetMatcher
create a new loopback matcher to match on the ip part a SocketAddr,
matching only if the IP is considered a private address.
This matcher will not match in case socket address could not be found,
if you want to match in case socket address could not be found,
use the PrivateIpNetMatcher::optional constructor..
pub fn optional() -> PrivateIpNetMatcher
pub fn optional() -> PrivateIpNetMatcher
create a new loopback matcher to match on the ip part a SocketAddr,
matching only if the IP is considered a private address or no socket address could be found.
This matcher will match in case socket address could not be found.
Use the PrivateIpNetMatcher::new constructor if you want do not want
to match in case socket address could not be found.
Trait Implementations§
§impl Clone for PrivateIpNetMatcher
impl Clone for PrivateIpNetMatcher
§fn clone(&self) -> PrivateIpNetMatcher
fn clone(&self) -> PrivateIpNetMatcher
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for PrivateIpNetMatcher
impl Debug for PrivateIpNetMatcher
§impl Default for PrivateIpNetMatcher
impl Default for PrivateIpNetMatcher
§fn default() -> PrivateIpNetMatcher
fn default() -> PrivateIpNetMatcher
§impl<Body> Matcher<Request<Body>> for PrivateIpNetMatcher
impl<Body> Matcher<Request<Body>> for PrivateIpNetMatcher
§fn matches(&self, _ext: Option<&mut Extensions>, req: &Request<Body>) -> bool
fn matches(&self, _ext: Option<&mut Extensions>, req: &Request<Body>) -> bool
§fn or<M>(self, other: M) -> impl Matcher<Request>
fn or<M>(self, other: M) -> impl Matcher<Request>
§impl<Socket> Matcher<Socket> for PrivateIpNetMatcherwhere
Socket: Socket,
impl<Socket> Matcher<Socket> for PrivateIpNetMatcherwhere
Socket: Socket,
§fn matches(&self, _ext: Option<&mut Extensions>, stream: &Socket) -> bool
fn matches(&self, _ext: Option<&mut Extensions>, stream: &Socket) -> bool
§fn or<M>(self, other: M) -> impl Matcher<Request>
fn or<M>(self, other: M) -> impl Matcher<Request>
Auto Trait Implementations§
impl Freeze for PrivateIpNetMatcher
impl RefUnwindSafe for PrivateIpNetMatcher
impl Send for PrivateIpNetMatcher
impl Sync for PrivateIpNetMatcher
impl Unpin for PrivateIpNetMatcher
impl UnwindSafe for PrivateIpNetMatcher
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
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> 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