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