pub enum BuildError {
DirectionNotSet {
rule_index: usize,
},
MissingDestination {
rule_index: usize,
},
InvalidIp {
rule_index: usize,
raw: String,
},
InvalidCidr {
rule_index: usize,
raw: String,
},
InvalidDomain {
rule_index: usize,
raw: String,
source: DomainNameError,
},
InvalidPortRange {
rule_index: usize,
lo: u16,
hi: u16,
},
IngressDoesNotSupportIcmp {
rule_index: usize,
},
}Expand description
Errors surfaced by NetworkPolicyBuilder::build and the related
nested builders (crate::builder::DnsBuilder::build,
crate::builder::NetworkBuilder::build).
All these builders accumulate errors lazily — string inputs are
stored raw and only parsed at .build() time, where the first
failure is returned. The same enum covers both rule-grammar
failures (with a rule_index) and DNS-block-list failures (no
rule index, since DNS blocks aren’t rules).
Variants§
DirectionNotSet
A rule was committed without setting a direction first.
MissingDestination
A rule was committed via .allow() / .deny() but no destination
method was called on the resulting RuleDestinationBuilder.
InvalidIp
.ip(&str) received a value that doesn’t parse as an IPv4 or
IPv6 address.
InvalidCidr
.cidr(&str) received a value that doesn’t parse as a CIDR.
InvalidDomain
.domain(&str) or .domain_suffix(&str) received a value that
doesn’t parse as a DomainName.
InvalidPortRange
.port_range(lo, hi) received lo > hi.
IngressDoesNotSupportIcmp
An ICMP protocol (icmpv4 / icmpv6) appears in a rule whose
direction is Ingress or Any. publisher.rs has no inbound
ICMP path; ingress ICMP rules would be dead code.
Trait Implementations§
Source§impl Clone for BuildError
impl Clone for BuildError
Source§fn clone(&self) -> BuildError
fn clone(&self) -> BuildError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BuildError
impl Debug for BuildError
Source§impl Display for BuildError
impl Display for BuildError
Source§impl Error for BuildError
impl Error for BuildError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()