pub struct HttpValidator;Expand description
Validation rules for HTTP requests
Implementations§
Source§impl HttpValidator
impl HttpValidator
Sourcepub fn validate_required_fields(
fields: &[(&str, Option<&str>)],
) -> Result<(), Vec<ValidationError>>
pub fn validate_required_fields( fields: &[(&str, Option<&str>)], ) -> Result<(), Vec<ValidationError>>
Validate required fields are present
Sourcepub fn validate_email(email: &str) -> Result<(), ValidationError>
pub fn validate_email(email: &str) -> Result<(), ValidationError>
Validate email format (basic check)
Sourcepub fn validate_length(
field_name: &str,
value: &str,
min: usize,
max: usize,
) -> Result<(), ValidationError>
pub fn validate_length( field_name: &str, value: &str, min: usize, max: usize, ) -> Result<(), ValidationError>
Validate string length
Sourcepub fn validate_range<T: PartialOrd + Display>(
field_name: &str,
value: T,
min: T,
max: T,
) -> Result<(), ValidationError>
pub fn validate_range<T: PartialOrd + Display>( field_name: &str, value: T, min: T, max: T, ) -> Result<(), ValidationError>
Validate numeric range
Auto Trait Implementations§
impl Freeze for HttpValidator
impl RefUnwindSafe for HttpValidator
impl Send for HttpValidator
impl Sync for HttpValidator
impl Unpin for HttpValidator
impl UnsafeUnpin for HttpValidator
impl UnwindSafe for HttpValidator
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