pub struct ProtocolValidator { /* private fields */ }
Expand description
Protocol message validator
Implementations§
Source§impl ProtocolValidator
impl ProtocolValidator
Sourcepub fn with_strict_mode(self) -> Self
pub fn with_strict_mode(self) -> Self
Enable strict validation mode
Sourcepub fn with_rules(self, rules: ValidationRules) -> Self
pub fn with_rules(self, rules: ValidationRules) -> Self
Set custom validation rules
Sourcepub fn validate_request(&self, request: &JsonRpcRequest) -> ValidationResult
pub fn validate_request(&self, request: &JsonRpcRequest) -> ValidationResult
Validate a JSON-RPC request
Sourcepub fn validate_response(&self, response: &JsonRpcResponse) -> ValidationResult
pub fn validate_response(&self, response: &JsonRpcResponse) -> ValidationResult
Validate a JSON-RPC response
Sourcepub fn validate_notification(
&self,
notification: &JsonRpcNotification,
) -> ValidationResult
pub fn validate_notification( &self, notification: &JsonRpcNotification, ) -> ValidationResult
Validate a JSON-RPC notification
Sourcepub fn validate_tool(&self, tool: &Tool) -> ValidationResult
pub fn validate_tool(&self, tool: &Tool) -> ValidationResult
Validate MCP protocol types
Sourcepub fn validate_prompt(&self, prompt: &Prompt) -> ValidationResult
pub fn validate_prompt(&self, prompt: &Prompt) -> ValidationResult
Validate a prompt
Sourcepub fn validate_resource(&self, resource: &Resource) -> ValidationResult
pub fn validate_resource(&self, resource: &Resource) -> ValidationResult
Validate a resource
Sourcepub fn validate_initialize_request(
&self,
request: &InitializeRequest,
) -> ValidationResult
pub fn validate_initialize_request( &self, request: &InitializeRequest, ) -> ValidationResult
Validate initialization request
Trait Implementations§
Source§impl Clone for ProtocolValidator
impl Clone for ProtocolValidator
Source§fn clone(&self) -> ProtocolValidator
fn clone(&self) -> ProtocolValidator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ProtocolValidator
impl Debug for ProtocolValidator
Auto Trait Implementations§
impl Freeze for ProtocolValidator
impl RefUnwindSafe for ProtocolValidator
impl Send for ProtocolValidator
impl Sync for ProtocolValidator
impl Unpin for ProtocolValidator
impl UnwindSafe for ProtocolValidator
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