pub struct RuleDestinationBuilder<'a> { /* private fields */ }Expand description
Returned by RuleBuilder::allow / RuleBuilder::deny. Requires
exactly one destination method call to commit the rule.
Dropping without a destination call silently does nothing — no rule
is added. The #[must_use] attribute warns at compile time.
Implementations§
Source§impl<'a> RuleDestinationBuilder<'a>
impl<'a> RuleDestinationBuilder<'a>
Sourcepub fn ip(self, ip: impl Into<String>) -> &'a mut RuleBuilder
pub fn ip(self, ip: impl Into<String>) -> &'a mut RuleBuilder
Commit the rule with destination Ip(<addr>). The string is
stored raw and parsed at NetworkPolicyBuilder::build time;
invalid IPs surface as BuildError::InvalidIp.
Sourcepub fn cidr(self, cidr: impl Into<String>) -> &'a mut RuleBuilder
pub fn cidr(self, cidr: impl Into<String>) -> &'a mut RuleBuilder
Commit the rule with destination Cidr(<network>).
Sourcepub fn domain(self, domain: impl Into<String>) -> &'a mut RuleBuilder
pub fn domain(self, domain: impl Into<String>) -> &'a mut RuleBuilder
Commit the rule with destination Domain(<name>). Matches only
when a cached hostname for the remote IP equals this name
(after canonicalization).
Sourcepub fn domain_suffix(self, suffix: impl Into<String>) -> &'a mut RuleBuilder
pub fn domain_suffix(self, suffix: impl Into<String>) -> &'a mut RuleBuilder
Commit the rule with destination DomainSuffix(<name>). Matches
the apex domain itself and any subdomain.
Sourcepub fn group(self, group: DestinationGroup) -> &'a mut RuleBuilder
pub fn group(self, group: DestinationGroup) -> &'a mut RuleBuilder
Commit the rule with destination Group(<group>).
Sourcepub fn any(self) -> &'a mut RuleBuilder
pub fn any(self) -> &'a mut RuleBuilder
Commit the rule with destination Any (matches every remote).
Auto Trait Implementations§
impl<'a> !UnwindSafe for RuleDestinationBuilder<'a>
impl<'a> Freeze for RuleDestinationBuilder<'a>
impl<'a> RefUnwindSafe for RuleDestinationBuilder<'a>
impl<'a> Send for RuleDestinationBuilder<'a>
impl<'a> Sync for RuleDestinationBuilder<'a>
impl<'a> Unpin for RuleDestinationBuilder<'a>
impl<'a> UnsafeUnpin for RuleDestinationBuilder<'a>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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> 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