pub struct SchemaDeriver { /* private fields */ }Expand description
Derives schemas from source + policy.
Implementations§
Source§impl SchemaDeriver
impl SchemaDeriver
Sourcepub fn new(
operations: Vec<Operation>,
policy: McpExposurePolicy,
source_hash: String,
) -> Self
pub fn new( operations: Vec<Operation>, policy: McpExposurePolicy, source_hash: String, ) -> Self
Create a new schema deriver.
Sourcepub fn derive_tools_schema(&self) -> DerivedSchema
pub fn derive_tools_schema(&self) -> DerivedSchema
Derive the MCP Tools schema.
Sourcepub fn derive_code_mode_schema(&self) -> DerivedSchema
pub fn derive_code_mode_schema(&self) -> DerivedSchema
Derive the Code Mode schema.
Sourcepub fn is_tool_allowed(&self, operation_id: &str) -> bool
pub fn is_tool_allowed(&self, operation_id: &str) -> bool
Check if an operation is allowed in tools.
Sourcepub fn is_code_mode_allowed(&self, operation_id: &str) -> bool
pub fn is_code_mode_allowed(&self, operation_id: &str) -> bool
Check if an operation is allowed in code mode.
Sourcepub fn get_tool_filter_reason(&self, operation_id: &str) -> Option<FilterReason>
pub fn get_tool_filter_reason(&self, operation_id: &str) -> Option<FilterReason>
Get the filter reason for an operation in tools context.
Sourcepub fn get_code_mode_filter_reason(
&self,
operation_id: &str,
) -> Option<FilterReason>
pub fn get_code_mode_filter_reason( &self, operation_id: &str, ) -> Option<FilterReason>
Get the filter reason for an operation in code mode context.
Sourcepub fn find_operation_id(
&self,
method: &str,
path_pattern: &str,
) -> Option<String>
pub fn find_operation_id( &self, method: &str, path_pattern: &str, ) -> Option<String>
Find operation ID by HTTP method and path pattern.
This enables looking up human-readable operationIds (like “updateProduct”) from METHOD:/path patterns (like “PUT:/products/*”).
§Arguments
method- HTTP method (e.g., “PUT”, “POST”)path_pattern- Path pattern with wildcards (e.g., “/products/*”)
§Returns
The operationId if a matching operation is found.
Auto Trait Implementations§
impl Freeze for SchemaDeriver
impl RefUnwindSafe for SchemaDeriver
impl Send for SchemaDeriver
impl Sync for SchemaDeriver
impl Unpin for SchemaDeriver
impl UnsafeUnpin for SchemaDeriver
impl UnwindSafe for SchemaDeriver
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 moreCreates a shared type from an unshared type.