pub struct Validator;
Expand description
Re-export commonly used types Protocol validation utilities
Implementations§
Source§impl Validator
impl Validator
Sourcepub fn validate_non_empty(value: &str, field_name: &str) -> Result<(), Error>
pub fn validate_non_empty(value: &str, field_name: &str) -> Result<(), Error>
Validate that a string is not empty
Sourcepub fn validate_tool_name(name: &str) -> Result<(), Error>
pub fn validate_tool_name(name: &str) -> Result<(), Error>
Validate a tool name (must be alphanumeric with underscores)
Sourcepub fn validate_tool_arguments(
args: &HashMap<String, Value>,
schema: &Value,
) -> Result<(), Error>
pub fn validate_tool_arguments( args: &HashMap<String, Value>, schema: &Value, ) -> Result<(), Error>
Validate tool arguments against a schema
Auto Trait Implementations§
impl Freeze for Validator
impl RefUnwindSafe for Validator
impl Send for Validator
impl Sync for Validator
impl Unpin for Validator
impl UnwindSafe 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