pub struct CustomResource {
pub uri: String,
pub name: String,
pub title: Option<String>,
pub description: Option<String>,
pub mime_type: Option<String>,
pub content: ResourceContent,
}Expand description
Descriptor for a custom MCP resource.
Add to crate::ClapMcpServeOptions::custom_resources to expose it when serving.
Fields§
§uri: StringMCP resource URI (e.g. myapp://config). Must be unique.
name: StringShort name for listing.
title: Option<String>Optional human-readable title.
description: Option<String>Optional description.
mime_type: Option<String>Optional MIME type (e.g. text/plain, application/json).
content: ResourceContentContent: static string or async provider.
Implementations§
Source§impl CustomResource
impl CustomResource
Sourcepub fn to_list_resource(&self) -> Resource
pub fn to_list_resource(&self) -> Resource
Build an MCP Resource for list_resources.
Trait Implementations§
Source§impl Clone for CustomResource
impl Clone for CustomResource
Source§fn clone(&self) -> CustomResource
fn clone(&self) -> CustomResource
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 moreAuto Trait Implementations§
impl Freeze for CustomResource
impl !RefUnwindSafe for CustomResource
impl Send for CustomResource
impl Sync for CustomResource
impl Unpin for CustomResource
impl UnsafeUnpin for CustomResource
impl !UnwindSafe for CustomResource
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