pub enum Content {
Text(TextContent),
Image(ImageContent),
Audio(AudioContent),
ResourceLink(ResourceLinkContent),
EmbeddedResource(EmbeddedResource),
Unknown(UnknownContent),
}Expand description
A content block.
Variants§
Text(TextContent)
A text block. Every revision, every transport.
Image(ImageContent)
A base64-encoded image. Every revision.
Audio(AudioContent)
Base64-encoded audio. 2025-03-26.
ResourceLink(ResourceLinkContent)
A link to a resource the client can read. 2025-06-18.
EmbeddedResource(EmbeddedResource)
The resource’s contents inline. Every revision.
Unknown(UnknownContent)
A content block this build does not recognise.
Holds the original wire shape so it can be forwarded unchanged. See the module docs for why this is not a shrug.
Implementations§
Source§impl Content
impl Content
Sourcepub fn required_features(&self) -> FeatureSet
pub fn required_features(&self) -> FeatureSet
The features this block needs in order to be expressed.
Empty for Text, Image, EmbeddedResource and Unknown, because all
four are expressible at every revision. The rest name the revision that
introduced them, and those are exactly the revisions where lowering this
block to a 2024-11-05 peer is a downgrade.
Sourcepub const fn annotations(&self) -> Option<&Annotations>
pub const fn annotations(&self) -> Option<&Annotations>
The block’s annotations, if it has any.
Trait Implementations§
impl StructuralPartialEq for Content
Auto Trait Implementations§
impl Freeze for Content
impl RefUnwindSafe for Content
impl Send for Content
impl Sync for Content
impl Unpin for Content
impl UnsafeUnpin for Content
impl UnwindSafe for Content
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