pub struct McpContent {
pub kind: &'static str,
pub text: String,
pub mime_type: Option<String>,
pub uri: Option<String>,
}Expand description
Content returned by tool and resource handlers.
Create with McpContent::text (plain text or JSON strings),
McpContent::json (marks MIME type as application/json),
McpContent::image (base64-encoded binary image data), or
McpContent::embedded (a resource embedded inline in a tool response).
Fields§
§kind: &'static str"text", "image", or "resource".
text: StringThe content string — text for "text", base64 data for "image",
or the embedded resource’s text for "resource".
mime_type: Option<String>Optional MIME type override (default "text/plain" for "text";
required in practice for "image"/"resource", set by their
constructors).
uri: Option<String>The resource URI — only set (and only serialized) for "resource".
Implementations§
Trait Implementations§
Source§impl Clone for McpContent
impl Clone for McpContent
Source§fn clone(&self) -> McpContent
fn clone(&self) -> McpContent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for McpContent
impl RefUnwindSafe for McpContent
impl Send for McpContent
impl Sync for McpContent
impl Unpin for McpContent
impl UnsafeUnpin for McpContent
impl UnwindSafe for McpContent
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