pub struct ArrayValidator<T, D>where
D: Dimension,{ /* private fields */ }
Expand description
Custom validator for array properties
Implementations§
Source§impl<T, D> ArrayValidator<T, D>where
D: Dimension,
impl<T, D> ArrayValidator<T, D>where
D: Dimension,
pub fn new() -> Self
pub fn withshape<F>(self, validator: F) -> Self
pub fn with_elements<V>(self, validator: V) -> Selfwhere
V: Validator<T> + 'static,
pub fn with_size(self, validator: RangeValidator<usize>) -> Self
pub fn minsize(self, minsize: usize) -> Self
pub fn maxsize(self, maxsize: usize) -> Self
pub fn exact_size(self, size: usize) -> Self
Trait Implementations§
Source§impl<T, D> Default for ArrayValidator<T, D>where
D: Dimension,
impl<T, D> Default for ArrayValidator<T, D>where
D: Dimension,
Source§impl<S, T, D> Validator<ArrayBase<S, D>> for ArrayValidator<T, D>
impl<S, T, D> Validator<ArrayBase<S, D>> for ArrayValidator<T, D>
Source§fn validate(&self, array: &ArrayBase<S, D>, name: &str) -> CoreResult<()>
fn validate(&self, array: &ArrayBase<S, D>, name: &str) -> CoreResult<()>
Validate the value and return Ok(()) if valid, or an error if invalid
Source§fn description(&self) -> String
fn description(&self) -> String
Get a description of what this validator checks
Auto Trait Implementations§
impl<T, D> Freeze for ArrayValidator<T, D>
impl<T, D> !RefUnwindSafe for ArrayValidator<T, D>
impl<T, D> !Send for ArrayValidator<T, D>
impl<T, D> !Sync for ArrayValidator<T, D>
impl<T, D> Unpin for ArrayValidator<T, D>where
D: Unpin,
impl<T, D> !UnwindSafe for ArrayValidator<T, D>
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