pub struct Resource {
pub resource_request_id: String,
pub uri: String,
pub name: Option<String>,
pub description: Option<String>,
pub resource_type: ResourceType,
pub content: Option<String>,
pub blob: Option<Vec<u8>>,
pub mime_type: Option<String>,
pub size_bytes: Option<u64>,
pub annotations: HashMap<String, Value>,
pub version: Option<String>,
}Expand description
Embedded resource with content (MCP).
Fields§
§resource_request_id: StringUnique request correlation ID.
uri: StringUnique identifier in URI format.
name: Option<String>Human-readable name.
description: Option<String>What this resource contains.
resource_type: ResourceTypeThe kind of resource.
content: Option<String>Text content if embedded.
blob: Option<Vec<u8>>Binary content if embedded (base64 in JSON).
mime_type: Option<String>MIME type of content.
size_bytes: Option<u64>Size information.
annotations: HashMap<String, Value>Metadata (classification, retention, etc.).
version: Option<String>Version tracking.
Implementations§
Source§impl Resource
impl Resource
Sourcepub fn is_embedded(&self) -> bool
pub fn is_embedded(&self) -> bool
Whether content or blob is embedded.
Sourcepub fn get_text_content(&self) -> Option<&str>
pub fn get_text_content(&self) -> Option<&str>
Get text content if available.
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 UnsafeUnpin 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