pub struct McpMockBuilder { /* private fields */ }Expand description
Fluent builder producing the expectations for a mocked MCP server.
Implementations§
Source§impl McpMockBuilder
impl McpMockBuilder
Sourcepub fn with_server_name(self, name: impl Into<String>) -> Self
pub fn with_server_name(self, name: impl Into<String>) -> Self
Set the advertised server name (default "MockMCPServer").
Sourcepub fn with_server_version(self, version: impl Into<String>) -> Self
pub fn with_server_version(self, version: impl Into<String>) -> Self
Set the advertised server version (default "1.0.0").
Sourcepub fn with_protocol_version(self, version: impl Into<String>) -> Self
pub fn with_protocol_version(self, version: impl Into<String>) -> Self
Set the advertised protocol version (default "2025-03-26").
Sourcepub fn with_tools_capability(self) -> Self
pub fn with_tools_capability(self) -> Self
Advertise the tools capability even with no tools defined.
Sourcepub fn with_resources_capability(self) -> Self
pub fn with_resources_capability(self) -> Self
Advertise the resources capability even with no resources defined.
Sourcepub fn with_prompts_capability(self) -> Self
pub fn with_prompts_capability(self) -> Self
Advertise the prompts capability even with no prompts defined.
Sourcepub fn with_tool(self, name: impl Into<String>) -> McpToolBuilder
pub fn with_tool(self, name: impl Into<String>) -> McpToolBuilder
Start defining a tool. Finish with McpToolBuilder::and.
Sourcepub fn with_resource(self, uri: impl Into<String>) -> McpResourceBuilder
pub fn with_resource(self, uri: impl Into<String>) -> McpResourceBuilder
Start defining a resource. Finish with McpResourceBuilder::and.
Sourcepub fn with_prompt(self, name: impl Into<String>) -> McpPromptBuilder
pub fn with_prompt(self, name: impl Into<String>) -> McpPromptBuilder
Start defining a prompt. Finish with McpPromptBuilder::and.
Sourcepub fn apply_to(&self, client: &MockServerClient) -> Result<Value>
pub fn apply_to(&self, client: &MockServerClient) -> Result<Value>
Build and register the expectations on the given client.
Trait Implementations§
Source§impl Clone for McpMockBuilder
impl Clone for McpMockBuilder
Source§fn clone(&self) -> McpMockBuilder
fn clone(&self) -> McpMockBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for McpMockBuilder
impl RefUnwindSafe for McpMockBuilder
impl Send for McpMockBuilder
impl Sync for McpMockBuilder
impl Unpin for McpMockBuilder
impl UnsafeUnpin for McpMockBuilder
impl UnwindSafe for McpMockBuilder
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