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: StringResource name (programmatic identifier)
title: Option<String>Display title for UI contexts (optional, falls back to name if not provided)
uri: StringThe 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<Resource, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Resource, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Resource
impl Serialize for Resource
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. 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§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)