pub struct McpValidationRule { /* private fields */ }Expand description
Static validator metadata attached to an MCP-visible field or filter.
Implementations§
Source§impl McpValidationRule
impl McpValidationRule
Sourcepub const fn new(
scope: McpValidationScope,
validator: &'static str,
path: &'static str,
label: Option<&'static str>,
type_arg_mode: McpValidationTypeArgMode,
params: &'static [McpValidationParam],
) -> Self
pub const fn new( scope: McpValidationScope, validator: &'static str, path: &'static str, label: Option<&'static str>, type_arg_mode: McpValidationTypeArgMode, params: &'static [McpValidationParam], ) -> Self
Create a validation rule descriptor for generated MCP metadata.
Sourcepub const fn with_target(self, target: McpValidationTarget) -> Self
pub const fn with_target(self, target: McpValidationTarget) -> Self
Attach a Koruma target selector to a rule descriptor.
Sourcepub const fn scope(self) -> McpValidationScope
pub const fn scope(self) -> McpValidationScope
Scope where this validator runs.
Sourcepub const fn label(self) -> Option<&'static str>
pub const fn label(self) -> Option<&'static str>
Optional source label assigned to this validator.
Sourcepub const fn target(self) -> Option<McpValidationTarget>
pub const fn target(self) -> Option<McpValidationTarget>
Optional Koruma target selector used by this validator.
Sourcepub const fn type_arg_mode(self) -> McpValidationTypeArgMode
pub const fn type_arg_mode(self) -> McpValidationTypeArgMode
Type argument syntax used by this validator.
Sourcepub const fn params(self) -> &'static [McpValidationParam]
pub const fn params(self) -> &'static [McpValidationParam]
Captured builder parameters for this validator.
pub fn to_value(self) -> Value
Trait Implementations§
Source§impl Clone for McpValidationRule
impl Clone for McpValidationRule
impl Copy for McpValidationRule
Source§impl Debug for McpValidationRule
impl Debug for McpValidationRule
impl Eq for McpValidationRule
Source§impl PartialEq for McpValidationRule
impl PartialEq for McpValidationRule
impl StructuralPartialEq for McpValidationRule
Auto Trait Implementations§
impl Freeze for McpValidationRule
impl RefUnwindSafe for McpValidationRule
impl Send for McpValidationRule
impl Sync for McpValidationRule
impl Unpin for McpValidationRule
impl UnsafeUnpin for McpValidationRule
impl UnwindSafe for McpValidationRule
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.