pub struct IpFilter { /* private fields */ }Available on crate feature
ip-filter only.Expand description
Allow / deny list of CIDR ranges.
Implementations§
Source§impl IpFilter
impl IpFilter
Sourcepub fn allow(self, cidr: &str) -> Result<IpFilter, AddrParseError>
pub fn allow(self, cidr: &str) -> Result<IpFilter, AddrParseError>
Adds a CIDR (or single IP) to the allow list.
Sourcepub fn deny(self, cidr: &str) -> Result<IpFilter, AddrParseError>
pub fn deny(self, cidr: &str) -> Result<IpFilter, AddrParseError>
Adds a CIDR (or single IP) to the deny list.
Sourcepub fn deny_unknown(self, deny: bool) -> IpFilter
pub fn deny_unknown(self, deny: bool) -> IpFilter
Reject requests whose peer IP cannot be determined.
Sourcepub fn status(self, status: StatusCode) -> IpFilter
pub fn status(self, status: StatusCode) -> IpFilter
Override the default 403 rejection status.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IpFilter
impl RefUnwindSafe for IpFilter
impl Send for IpFilter
impl Sync for IpFilter
impl Unpin for IpFilter
impl UnsafeUnpin for IpFilter
impl UnwindSafe for IpFilter
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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