pub enum Validator<T, S> {
None,
Custom(Rc<dyn Fn(ValidationContext<T>) -> S>),
}Variants§
None
Custom(Rc<dyn Fn(ValidationContext<T>) -> S>)
Implementations§
Source§impl<T, S> Validator<T, S>
impl<T, S> Validator<T, S>
pub fn is_custom(&self) -> bool
Sourcepub fn run<C>(&self, ctx: C) -> Option<S>where
C: Into<ValidationContext<T>>,
pub fn run<C>(&self, ctx: C) -> Option<S>where
C: Into<ValidationContext<T>>,
Convert into the context and run
Sourcepub fn run_if<F>(&self, f: F) -> Option<S>where
F: FnOnce() -> ValidationContext<T>,
pub fn run_if<F>(&self, f: F) -> Option<S>where
F: FnOnce() -> ValidationContext<T>,
Only convert when necessary, and run.
Sourcepub fn run_ctx(&self, ctx: ValidationContext<T>) -> Option<S>
pub fn run_ctx(&self, ctx: ValidationContext<T>) -> Option<S>
Run with the provided context.
Trait Implementations§
Auto Trait Implementations§
impl<T, S> Freeze for Validator<T, S>
impl<T, S> !RefUnwindSafe for Validator<T, S>
impl<T, S> !Send for Validator<T, S>
impl<T, S> !Sync for Validator<T, S>
impl<T, S> Unpin for Validator<T, S>
impl<T, S> !UnwindSafe for Validator<T, S>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self to a value of a Properties struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self to a value of a Properties struct.