pub struct EmbeddedResource {
pub annotations: Option<Annotations>,
pub meta: Option<Map<String, Value>>,
pub resource: EmbeddedResourceResource,
/* private fields */
}Expand description
The contents of a resource, embedded into a prompt or tool call result. It is up to the client how best to render embedded resources for the benefit of the LLM and/or the user.
JSON schema
{
"description": "The contents of a resource, embedded into a prompt or tool call result.\n\nIt is up to the client how best to render embedded resources for the benefit\nof the LLM and/or the user.",
"type": "object",
"required": [
"resource",
"type"
],
"properties": {
"_meta": {
"description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
"type": "object",
"additionalProperties": {}
},
"annotations": {
"description": "Optional annotations for the client.",
"$ref": "#/$defs/Annotations"
},
"resource": {
"anyOf": [
{
"$ref": "#/$defs/TextResourceContents"
},
{
"$ref": "#/$defs/BlobResourceContents"
}
]
},
"type": {
"type": "string",
"const": "resource"
}
}
}Fields§
§annotations: Option<Annotations>Optional annotations for the client.
meta: Option<Map<String, Value>>See General fields: _meta for notes on _meta usage.
resource: EmbeddedResourceResourceImplementations§
Source§impl EmbeddedResource
impl EmbeddedResource
pub fn new( resource: EmbeddedResourceResource, annotations: Option<Annotations>, meta: Option<Map<String, Value>>, ) -> Self
pub fn type_(&self) -> &String
Sourcepub fn type_value() -> &'static str
pub fn type_value() -> &'static str
returns “resource”
pub fn type_name() -> &'static str
👎Deprecated since 0.8.0: Use
type_value() instead.Trait Implementations§
Source§impl Clone for EmbeddedResource
impl Clone for EmbeddedResource
Source§fn clone(&self) -> EmbeddedResource
fn clone(&self) -> EmbeddedResource
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EmbeddedResource
impl Debug for EmbeddedResource
Source§impl<'de> Deserialize<'de> for EmbeddedResource
impl<'de> Deserialize<'de> for EmbeddedResource
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
Source§impl From<EmbeddedResource> for ContentBlock
impl From<EmbeddedResource> for ContentBlock
Source§fn from(value: EmbeddedResource) -> Self
fn from(value: EmbeddedResource) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for EmbeddedResource
impl RefUnwindSafe for EmbeddedResource
impl Send for EmbeddedResource
impl Sync for EmbeddedResource
impl Unpin for EmbeddedResource
impl UnwindSafe for EmbeddedResource
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)