pub struct AccessControlSetBuilder(/* private fields */);Expand description
A builder interface for constructing an AccessControlSet.
Implementations§
Source§impl<'a> AccessControlSetBuilder
impl<'a> AccessControlSetBuilder
Sourcepub fn new(name: &'static str) -> Self
pub fn new(name: &'static str) -> Self
Construct a builder for an access control set with the given name.
The name is used to contextualize logging when an IpAddr is denied.
Sourcepub fn allow(self, allow: impl Iterator<Item = &'a IpNet>) -> Self
pub fn allow(self, allow: impl Iterator<Item = &'a IpNet>) -> Self
Override the Self::deny() list for the provided IP networks, allowing access.
Existing networks allowed by prior Self::allow() calls are not removed.
See AccessControlSet for more information on the access semantics.
Sourcepub fn deny(self, deny: impl Iterator<Item = &'a IpNet>) -> Self
pub fn deny(self, deny: impl Iterator<Item = &'a IpNet>) -> Self
Deny clients from the provided IP networks, unless present in the Self::allow() list.
Existing networks denied by prior Self::deny() calls are not removed.
See AccessControlSet for more information on the access semantics.
Sourcepub fn clear_allow(self) -> Self
pub fn clear_allow(self) -> Self
Clear all IP networks previous allowed with Self::allow().
Sourcepub fn clear_deny(self) -> Self
pub fn clear_deny(self) -> Self
Clear all IP networks previously denied with Self::deny().
Sourcepub fn build(self) -> Result<AccessControlSet, ProtoError>
pub fn build(self) -> Result<AccessControlSet, ProtoError>
Consume the builder and produce an AccessControlSet.
Returns an error if Self::allow() was used to add deny list override networks
without using Self::deny() to specify one or more denied networks.
Auto Trait Implementations§
impl !Freeze for AccessControlSetBuilder
impl !RefUnwindSafe for AccessControlSetBuilder
impl Send for AccessControlSetBuilder
impl Sync for AccessControlSetBuilder
impl Unpin for AccessControlSetBuilder
impl UnsafeUnpin for AccessControlSetBuilder
impl UnwindSafe for AccessControlSetBuilder
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
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>
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