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).