pub struct InputValidator { /* private fields */ }Expand description
Input validator with configurable rules.
Implementations§
Source§impl InputValidator
impl InputValidator
Sourcepub fn with_max_length(self, max: usize) -> Self
pub fn with_max_length(self, max: usize) -> Self
Set maximum input length.
Sourcepub fn with_min_length(self, min: usize) -> Self
pub fn with_min_length(self, min: usize) -> Self
Set minimum input length.
Sourcepub fn forbid_pattern(self, pattern: impl Into<String>) -> Self
pub fn forbid_pattern(self, pattern: impl Into<String>) -> Self
Add a forbidden pattern (case-insensitive).
Sourcepub fn validate(&self, input: &str) -> ValidationResult
pub fn validate(&self, input: &str) -> ValidationResult
Validate input text.
Sourcepub fn validate_tool_params(&self, params: &Value) -> ValidationResult
pub fn validate_tool_params(&self, params: &Value) -> ValidationResult
Validate tool parameters (recursively checks all string values in JSON).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InputValidator
impl RefUnwindSafe for InputValidator
impl Send for InputValidator
impl Sync for InputValidator
impl Unpin for InputValidator
impl UnsafeUnpin for InputValidator
impl UnwindSafe for InputValidator
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