#[non_exhaustive]pub enum CompilationError {
Parse {
rule: String,
source: Box<dyn Error + Send + Sync>,
},
MessageExpressionParse {
rule: String,
message_expression: String,
source: Box<dyn Error + Send + Sync>,
},
InvalidRule(Error),
SchemaTooDeep {
depth: usize,
},
}Available on crate feature
validation only.Expand description
Errors that can occur during rule compilation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Parse
CEL expression failed to parse.
Fields
MessageExpressionParse
A rule’s messageExpression failed to parse. The rule itself is
well-formed, but its dynamic error message cannot be compiled. Surfaced as
a compilation error (rather than silently dropped) so the rule fails
closed, mirroring the apiserver, which rejects such a CRD at registration.
Fields
InvalidRule(Error)
JSON value could not be deserialized into a Rule.
SchemaTooDeep
Schema nesting exceeded the maximum depth. The over-deep subtree was refused rather than silently truncated, so a too-deep schema cannot quietly drop the validation rules nested beneath the cap (fail-closed).
Trait Implementations§
Source§impl Debug for CompilationError
impl Debug for CompilationError
Source§impl Display for CompilationError
impl Display for CompilationError
Source§impl Error for CompilationError
impl Error for CompilationError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for CompilationError
impl !UnwindSafe for CompilationError
impl Freeze for CompilationError
impl Send for CompilationError
impl Sync for CompilationError
impl Unpin for CompilationError
impl UnsafeUnpin for CompilationError
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
Attempts to downcast this to
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
Attempts to downcast this to
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
Attempts to downcast this to
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
Attempts to downcast this to
T behind Arc pointerSource§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
Mutably borrows from an owned value. Read more