pub enum BuildError {
Show 19 variants
DirectionNotSet {
rule_index: usize,
},
MissingDestination {
rule_index: usize,
},
InvalidIp {
rule_index: usize,
raw: String,
},
InvalidCidr {
rule_index: usize,
raw: String,
},
InvalidIpv4Pool {
raw: String,
},
InvalidIpv6Pool {
raw: String,
},
InvalidOutboundProxy {
reason: String,
},
MaxConnectionsExceeded {
configured: usize,
limit: usize,
},
IncompleteInterceptCaConfig,
InvalidDomain {
rule_index: usize,
raw: String,
source: DomainNameError,
},
InvalidPortRange {
rule_index: usize,
lo: u16,
hi: u16,
},
IngressDoesNotSupportIcmp {
rule_index: usize,
},
InvalidSecretConfig {
source: SecretConfigError,
},
InvalidRateLimitConfig {
direction: NetworkRateLimitDirection,
source: RateLimitConfigError,
},
EmptyNetworkRateLimiter,
RateLimitBurstWithoutBucket {
direction: NetworkRateLimitDirection,
bucket: &'static str,
},
RateLimitRefillTooShort {
direction: NetworkRateLimitDirection,
bucket: &'static str,
},
RateLimitRefillPrecision {
direction: NetworkRateLimitDirection,
bucket: &'static str,
},
RateLimitRefillTooLong {
direction: NetworkRateLimitDirection,
bucket: &'static str,
},
}Expand description
Errors surfaced by NetworkPolicyBuilder::build and the related
nested builders (crate::config::DnsBuilder::build,
crate::config::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.
InvalidIpv4Pool
The configured guest IPv4 pool cannot hold a /30 sandbox subnet.
InvalidIpv6Pool
The configured guest IPv6 pool cannot hold a /64 sandbox prefix.
InvalidOutboundProxy
An outbound proxy builder received an invalid configuration.
MaxConnectionsExceeded
The configured connection limit is above the network stack’s hard cap.
Fields
IncompleteInterceptCaConfig
Exactly one TLS intercept CA path was configured.
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.
InvalidSecretConfig
A secret entry failed validation.
Fields
source: SecretConfigErrorUnderlying secret validation error.
InvalidRateLimitConfig
A rate limiter failed validation.
Fields
direction: NetworkRateLimitDirectionWhich limiter is invalid: egress or ingress.
source: RateLimitConfigErrorUnderlying rate limit validation error.
EmptyNetworkRateLimiter
A network rate limiter was configured without either direction.
RateLimitBurstWithoutBucket
A one-time burst was set without its corresponding bucket.
Fields
direction: NetworkRateLimitDirectionWhich limiter is invalid: egress or ingress.
RateLimitRefillTooShort
A rate limiter refill interval is shorter than the wire format supports.
Fields
direction: NetworkRateLimitDirectionWhich limiter is invalid: egress or ingress.
RateLimitRefillPrecision
A rate limiter refill interval cannot be represented exactly in milliseconds.
Fields
direction: NetworkRateLimitDirectionWhich limiter is invalid: egress or ingress.
RateLimitRefillTooLong
A rate limiter refill interval does not fit in u64 milliseconds.
Fields
direction: NetworkRateLimitDirectionWhich limiter is invalid: egress or ingress.
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()
Source§impl From<SecretConfigError> for BuildError
impl From<SecretConfigError> for BuildError
Source§fn from(source: SecretConfigError) -> Self
fn from(source: SecretConfigError) -> Self
Auto Trait Implementations§
impl Freeze for BuildError
impl RefUnwindSafe for BuildError
impl Send for BuildError
impl Sync for BuildError
impl Unpin for BuildError
impl UnsafeUnpin for BuildError
impl UnwindSafe for BuildError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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