pub struct RouteMapping { /* private fields */ }Expand description
Configuration for mapping OpenAPI operations to MCP components.
Implementations§
Source§impl RouteMapping
impl RouteMapping
Sourcepub fn default_rules() -> Self
pub fn default_rules() -> Self
Create default mapping rules:
- GET → Resource
- POST, PUT, PATCH, DELETE → Tool
Sourcepub fn map_methods<I, S>(self, methods: I, mcp_type: McpType) -> Self
pub fn map_methods<I, S>(self, methods: I, mcp_type: McpType) -> Self
Add a rule to map specific HTTP methods to an MCP type.
Sourcepub fn map_method(self, method: &str, mcp_type: McpType) -> Self
pub fn map_method(self, method: &str, mcp_type: McpType) -> Self
Add a rule to map a specific HTTP method to an MCP type.
Sourcepub fn map_pattern(self, pattern: &str, mcp_type: McpType) -> Result<Self>
pub fn map_pattern(self, pattern: &str, mcp_type: McpType) -> Result<Self>
Add a rule to map paths matching a pattern to an MCP type.
Sourcepub fn map_rule<I, S>(
self,
methods: I,
pattern: &str,
mcp_type: McpType,
priority: i32,
) -> Result<Self>
pub fn map_rule<I, S>( self, methods: I, pattern: &str, mcp_type: McpType, priority: i32, ) -> Result<Self>
Add a rule to map specific methods and pattern to an MCP type.
Sourcepub fn skip_pattern(self, pattern: &str) -> Result<Self>
pub fn skip_pattern(self, pattern: &str) -> Result<Self>
Skip operations matching a pattern.
Sourcepub fn get_mcp_type(&self, method: &str, path: &str) -> McpType
pub fn get_mcp_type(&self, method: &str, path: &str) -> McpType
Determine the MCP type for a given HTTP method and path.
Rules are checked in order of priority (highest first), then insertion order.
Returns McpType::Tool as default if no rule matches.
Trait Implementations§
Source§impl Clone for RouteMapping
impl Clone for RouteMapping
Source§fn clone(&self) -> RouteMapping
fn clone(&self) -> RouteMapping
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 RouteMapping
impl Debug for RouteMapping
Source§impl Default for RouteMapping
impl Default for RouteMapping
Source§fn default() -> RouteMapping
fn default() -> RouteMapping
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RouteMapping
impl RefUnwindSafe for RouteMapping
impl Send for RouteMapping
impl Sync for RouteMapping
impl Unpin for RouteMapping
impl UnsafeUnpin for RouteMapping
impl UnwindSafe for RouteMapping
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