pub struct Validator { /* private fields */ }Available on non-WebAssembly only.
Expand description
Builder for complex validations
§Example
use pmcp::server::validation::Validator;
let mut v = Validator::new();
v.field("age", 25).range(&18, &120);
v.field("email", "user@example.com").email();
v.field("country", "US").one_of(&["US", "UK", "CA"]);
v.validate()?;Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Validator
impl !UnwindSafe for Validator
impl Freeze for Validator
impl Send for Validator
impl Sync for Validator
impl Unpin for Validator
impl UnsafeUnpin for Validator
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