Struct ruma_common::events::room::message::ImageMessageEventContent
source · pub struct ImageMessageEventContent {
pub body: String,
pub source: MediaSource,
pub info: Option<Box<ImageInfo>>,
}Available on crate feature
events only.Expand description
The payload for an image message.
Fields§
§body: StringA textual representation of the image.
Could be the alt text of the image, the filename of the image, or some kind of content description for accessibility e.g. “image attachment”.
source: MediaSourceThe source of the image.
info: Option<Box<ImageInfo>>Metadata about the image referred to in source.
Implementations§
source§impl ImageMessageEventContent
impl ImageMessageEventContent
sourcepub fn plain(body: String, url: OwnedMxcUri, info: Option<Box<ImageInfo>>) -> Self
pub fn plain(body: String, url: OwnedMxcUri, info: Option<Box<ImageInfo>>) -> Self
Creates a new non-encrypted ImageMessageEventContent with the given body, url and
optional extra info.
sourcepub fn encrypted(body: String, file: EncryptedFile) -> Self
pub fn encrypted(body: String, file: EncryptedFile) -> Self
Creates a new encrypted ImageMessageEventContent with the given body and encrypted
file.
Trait Implementations§
source§impl Clone for ImageMessageEventContent
impl Clone for ImageMessageEventContent
source§fn clone(&self) -> ImageMessageEventContent
fn clone(&self) -> ImageMessageEventContent
Returns a copy 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 ImageMessageEventContent
impl Debug for ImageMessageEventContent
source§impl<'de> Deserialize<'de> for ImageMessageEventContent
impl<'de> Deserialize<'de> for ImageMessageEventContent
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