pub struct Resource {
pub name: String,
pub title: Option<String>,
pub uri: String,
pub description: Option<String>,
pub mime_type: Option<String>,
pub annotations: Option<Annotations>,
pub size: Option<u64>,
pub meta: Option<HashMap<String, Value>>,
}
Expand description
Resource definition per MCP 2025-06-18 specification
Fields§
§name: String
Resource name (programmatic identifier)
title: Option<String>
Display title for UI contexts (optional, falls back to name if not provided)
uri: String
The URI of this resource
description: Option<String>
A description of what this resource represents This can be used by clients to improve the LLM’s understanding of available resources
mime_type: Option<String>
The MIME type of this resource, if known
annotations: Option<Annotations>
Optional annotations for the client
size: Option<u64>
The size of the raw resource content, in bytes (before base64 encoding or tokenization), if known This can be used by Hosts to display file sizes and estimate context window usage
meta: Option<HashMap<String, Value>>
General metadata field for extensions and custom data
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