Struct ruma_common::events::room::message::ImageMessageEventContent
source · pub struct ImageMessageEventContent {
pub body: String,
pub source: MediaSource,
pub info: Option<Box<ImageInfo>>,
pub message: Option<MessageContent>,
pub file: Option<FileContent>,
pub image: Option<Box<ImageContent>>,
pub thumbnail: Option<Vec<ThumbnailContent>>,
pub caption: Option<MessageContent>,
}events only.Expand description
The payload for an image message.
With the unstable-msc3552 feature, this type contains the transitional format of
ImageEventContent. See the documentation of the message module for more information.
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.
message: Option<MessageContent>unstable-msc3552 only.Extensible-event text representation of the message.
If present, this should be preferred over the body field.
file: Option<FileContent>unstable-msc3552 only.Extensible-event file content of the message.
If present, this should be preferred over the source and info fields.
image: Option<Box<ImageContent>>unstable-msc3552 only.Extensible-event image info of the message.
If present, this should be preferred over the info field.
thumbnail: Option<Vec<ThumbnailContent>>unstable-msc3552 only.Extensible-event thumbnails of the message.
If present, this should be preferred over the info field.
caption: Option<MessageContent>unstable-msc3552 only.Extensible-event captions of the message.
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
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more