pub struct Resource {
pub uri: String,
pub name: String,
pub description: Option<String>,
pub resource_type: Option<String>,
}
Expand description
Represents an MCP resource with its metadata.
Resources are data exposed by the MCP server that can be retrieved by clients. Each resource has a URI that uniquely identifies it, along with metadata.
§Examples
use mcp_runner::client::Resource;
let resource = Resource {
uri: "res:fetch/settings".to_string(),
name: "Fetch Settings".to_string(),
description: Some("Configuration settings for fetch operations".to_string()),
resource_type: Some("application/json".to_string()),
};
Fields§
§uri: String
Unique URI identifying the resource.
name: String
Human-readable name of the resource.
description: Option<String>
Optional description of the resource’s content or purpose.
resource_type: Option<String>
Optional MIME type or format of the resource.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Resource
impl<'de> Deserialize<'de> for Resource
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Resource
impl RefUnwindSafe for Resource
impl Send for Resource
impl Sync for Resource
impl Unpin for Resource
impl UnwindSafe for Resource
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