pub struct ValidationManager { /* private fields */ }
Expand description
Input validation and sanitization manager
Implementations§
Source§impl ValidationManager
impl ValidationManager
pub fn new(config: ValidationConfig) -> Result<Self>
Sourcepub fn validate_input(&self, input: &str) -> Result<String>
pub fn validate_input(&self, input: &str) -> Result<String>
Validate and sanitize input string
Sourcepub fn validate_json(&self, json_str: &str) -> Result<Value>
pub fn validate_json(&self, json_str: &str) -> Result<Value>
Validate JSON payload
Sourcepub fn validate_headers(&self, headers: &HeaderMap) -> Result<()>
pub fn validate_headers(&self, headers: &HeaderMap) -> Result<()>
Validate HTTP headers
Sourcepub fn validate_content_type(&self, content_type: Option<&str>) -> Result<()>
pub fn validate_content_type(&self, content_type: Option<&str>) -> Result<()>
Check if content type is allowed
pub fn is_enabled(&self) -> bool
pub fn get_max_request_size(&self) -> u64
Auto Trait Implementations§
impl Freeze for ValidationManager
impl RefUnwindSafe for ValidationManager
impl Send for ValidationManager
impl Sync for ValidationManager
impl Unpin for ValidationManager
impl UnwindSafe for ValidationManager
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> 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> 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