pub type Content = ContentBlock;Expand description
Backward compatibility alias for ContentBlock.
The MCP specification originally named this type Content, but later renamed it to
ContentBlock for clarity. This alias exists to maintain backward compatibility with
code written against earlier versions of the TurboMCP SDK.
For new code, prefer using ContentBlock directly as it matches the current
MCP specification terminology.
§Example
use turbomcp_protocol::types::{Content, ContentBlock, TextContent};
// Both are equivalent:
let content_old: Content = ContentBlock::Text(TextContent {
text: "Hello".to_string(),
annotations: None,
meta: None,
});
let content_new: ContentBlock = ContentBlock::Text(TextContent {
text: "Hello".to_string(),
annotations: None,
meta: None,
});Aliased Type§
pub enum Content {
Text(TextContent),
Image(ImageContent),
Audio(AudioContent),
ResourceLink(ResourceLink),
Resource(EmbeddedResource),
}Variants§
Text(TextContent)
Text content
Image(ImageContent)
Image content
Audio(AudioContent)
Audio content
ResourceLink(ResourceLink)
Resource link
Resource(EmbeddedResource)
Embedded resource