pub struct ValidatorRegistry { /* private fields */ }Expand description
Registry that maps FileType values to validator factories.
This is the extension point for the validation engine. A
ValidatorRegistry owns a set of ValidatorFactory functions for each
supported FileType, and constructs concrete Validator instances on
demand.
Most callers should use ValidatorRegistry::with_defaults to obtain a
registry pre-populated with all built-in validators.
Implementations§
Source§impl ValidatorRegistry
impl ValidatorRegistry
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a registry pre-populated with built-in validators.
Sourcepub fn register(&mut self, file_type: FileType, factory: ValidatorFactory)
pub fn register(&mut self, file_type: FileType, factory: ValidatorFactory)
Register a validator factory for a given file type.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ValidatorRegistry
impl RefUnwindSafe for ValidatorRegistry
impl Send for ValidatorRegistry
impl Sync for ValidatorRegistry
impl Unpin for ValidatorRegistry
impl UnsafeUnpin for ValidatorRegistry
impl UnwindSafe for ValidatorRegistry
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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