#[non_exhaustive]pub enum ValidatorOption {
FailFast,
DisableLazy,
NowFn(Arc<dyn Fn() -> Timestamp + Send + Sync>),
AdditionalDescriptorSetBytes(Vec<u8>),
MessageDescriptors(Vec<MessageDescriptor>),
AllowUnknownFields,
}Expand description
Options for configuring the Validator at construction time.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
FailFast
Stop validation on the first violation instead of collecting all.
DisableLazy
Disable lazy compilation: all known message types must be pre-registered, and unknown types will produce a compilation error.
NowFn(Arc<dyn Fn() -> Timestamp + Send + Sync>)
Override the function used to populate now in timestamp-based rules/CEL.
AdditionalDescriptorSetBytes(Vec<u8>)
Additional encoded FileDescriptorSet payloads used to resolve
custom/proprietary rule extensions at runtime.
MessageDescriptors(Vec<MessageDescriptor>)
Preload evaluators for these descriptors at validator construction time.
Useful with DisableLazy to allow a fixed set of message types.
AllowUnknownFields
Allow unknown fields in constraint messages instead of producing a compilation error. Useful when working with newer constraint protos that contain fields not yet recognized by this library.
Auto Trait Implementations§
impl Freeze for ValidatorOption
impl !RefUnwindSafe for ValidatorOption
impl Send for ValidatorOption
impl Sync for ValidatorOption
impl Unpin for ValidatorOption
impl UnsafeUnpin for ValidatorOption
impl !UnwindSafe for ValidatorOption
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,
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,
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,
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,
T behind Arc pointer