pub enum ContentBlock {
Text {
text: String,
annotations: Option<Annotations>,
meta: Option<HashMap<String, Value>>,
},
Image {
data: String,
mime_type: String,
annotations: Option<Annotations>,
meta: Option<HashMap<String, Value>>,
},
Audio {
data: String,
mime_type: String,
annotations: Option<Annotations>,
meta: Option<HashMap<String, Value>>,
},
ResourceLink {
uri: String,
name: String,
description: Option<String>,
mime_type: Option<String>,
size: Option<u64>,
title: Option<String>,
annotations: Option<Annotations>,
meta: Option<HashMap<String, Value>>,
},
Resource {
resource: ResourceContents,
annotations: Option<Annotations>,
meta: Option<HashMap<String, Value>>,
},
}
Expand description
ContentBlock union type (2025-06-18 complete with ResourceLink)
Variants§
Text
Text content
Fields
§
annotations: Option<Annotations>
Content annotations (2025-06-18)
Image
Image content
Fields
§
annotations: Option<Annotations>
Content annotations (2025-06-18)
Audio
Audio content (2025-06-18)
Fields
§
annotations: Option<Annotations>
Content annotations (2025-06-18)
ResourceLink
ResourceLink content (2025-06-18 NEW)
Fields
§
annotations: Option<Annotations>
Content annotations (2025-06-18)
Resource
Embedded resource content (2025-06-18)
Fields
§
resource: ResourceContents
Resource contents
§
annotations: Option<Annotations>
Content annotations (2025-06-18)
Implementations§
Source§impl ContentBlock
impl ContentBlock
Sourcepub fn resource_link<S: Into<String>>(uri: S, name: S) -> Self
pub fn resource_link<S: Into<String>>(uri: S, name: S) -> Self
Create resource link content (2025-06-18 NEW)
Sourcepub fn embedded_resource(resource: ResourceContents) -> Self
pub fn embedded_resource(resource: ResourceContents) -> Self
Create embedded resource content (2025-06-18)
Trait Implementations§
Source§impl Clone for ContentBlock
impl Clone for ContentBlock
Source§fn clone(&self) -> ContentBlock
fn clone(&self) -> ContentBlock
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ContentBlock
impl Debug for ContentBlock
Source§impl<'de> Deserialize<'de> for ContentBlock
impl<'de> Deserialize<'de> for ContentBlock
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 PartialEq for ContentBlock
impl PartialEq for ContentBlock
Source§impl Serialize for ContentBlock
impl Serialize for ContentBlock
impl StructuralPartialEq for ContentBlock
Auto Trait Implementations§
impl Freeze for ContentBlock
impl RefUnwindSafe for ContentBlock
impl Send for ContentBlock
impl Sync for ContentBlock
impl Unpin for ContentBlock
impl UnwindSafe for ContentBlock
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