pub struct ResourceContent {
pub uri: String,
pub mime_type: Option<String>,
pub content: String,
}Expand description
Resource content for MCP resources/read response.
This struct contains the actual content of a resource when read through the MCP protocol. It includes the resource URI, optional MIME type, and the content as a string.
§Fields
uri: The URI of the resource being returnedmime_type: Optional MIME type of the contentcontent: The actual content of the resource as a string
§Example
use solidmcp::handler::ResourceContent;
let content = ResourceContent {
uri: "db://users/123".to_string(),
mime_type: Some("application/json".to_string()),
content: r#"{"id": 123, "name": "Alice", "email": "alice@example.com"}"#.to_string(),
};Fields§
§uri: String§mime_type: Option<String>§content: StringTrait Implementations§
Source§impl Clone for ResourceContent
impl Clone for ResourceContent
Source§fn clone(&self) -> ResourceContent
fn clone(&self) -> ResourceContent
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 moreAuto Trait Implementations§
impl Freeze for ResourceContent
impl RefUnwindSafe for ResourceContent
impl Send for ResourceContent
impl Sync for ResourceContent
impl Unpin for ResourceContent
impl UnwindSafe for ResourceContent
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)