Type Alias Content

Source
pub type Content = Annotated<RawContent>;

Aliased Type§

pub struct Content {
    pub raw: RawContent,
    pub annotations: Option<Annotations>,
}

Fields§

§raw: RawContent§annotations: Option<Annotations>

Implementations§

Source§

impl Content

Source

pub fn text<S: Into<String>>(text: S) -> Self

Source

pub fn image<S: Into<String>, T: Into<String>>(data: S, mime_type: T) -> Self

Source

pub fn resource(resource: ResourceContents) -> Self

Source

pub fn embedded_text<S: Into<String>, T: Into<String>>( uri: S, content: T, ) -> Self

Source

pub fn json<S: Serialize>(json: S) -> Result<Self, Error>

Trait Implementations§