#[non_exhaustive]pub struct ImageEventContent {
pub text: TextContentBlock,
pub file: FileContentBlock,
pub image_details: Option<ImageDetailsContentBlock>,
pub thumbnail: ThumbnailContentBlock,
pub caption: Option<CaptionContentBlock>,
pub alt_text: Option<AltTextContentBlock>,
pub automated: bool,
pub relates_to: Option<Relation<ImageEventContentWithoutRelation>>,
}
Expand description
The payload for an extensible image message.
This is the new primary type introduced in MSC3552 and should only be sent in rooms with a
version that supports it. This type replaces both the m.room.message
type with msgtype: "m.image"
and the m.sticker
type. To replace the latter, sticker
must be set to true
in
image_details
. See the documentation of the message
module for more information.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.text: TextContentBlock
The text representation of the message.
file: FileContentBlock
The file content of the message.
image_details: Option<ImageDetailsContentBlock>
The image details of the message, if any.
thumbnail: ThumbnailContentBlock
The thumbnails of the message, if any.
This is optional and defaults to an empty array.
The caption of the message, if any.
alt_text: Option<AltTextContentBlock>
The alternative text of the image, for accessibility considerations, if any.
automated: bool
Whether this message is automated.
relates_to: Option<Relation<ImageEventContentWithoutRelation>>
Information about related messages.
Implementations§
Source§impl ImageEventContent
impl ImageEventContent
Sourcepub fn new(text: TextContentBlock, file: FileContentBlock) -> Self
pub fn new(text: TextContentBlock, file: FileContentBlock) -> Self
Creates a new ImageEventContent
with the given fallback representation and
file.
Sourcepub fn with_plain_text(
plain_text: impl Into<String>,
file: FileContentBlock,
) -> Self
pub fn with_plain_text( plain_text: impl Into<String>, file: FileContentBlock, ) -> Self
Creates a new ImageEventContent
with the given plain text fallback representation and
file.
Trait Implementations§
Source§impl Clone for ImageEventContent
impl Clone for ImageEventContent
Source§fn clone(&self) -> ImageEventContent
fn clone(&self) -> ImageEventContent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ImageEventContent
impl Debug for ImageEventContent
Source§impl<'de> Deserialize<'de> for ImageEventContent
impl<'de> Deserialize<'de> for ImageEventContent
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>,
Source§impl EventContent for ImageEventContent
impl EventContent for ImageEventContent
Source§type EventType = MessageLikeEventType
type EventType = MessageLikeEventType
Source§fn event_type(&self) -> Self::EventType
fn event_type(&self) -> Self::EventType
m.room.message
.Source§impl From<ImageEventContent> for AnyMessageLikeEventContent
impl From<ImageEventContent> for AnyMessageLikeEventContent
Source§fn from(c: ImageEventContent) -> Self
fn from(c: ImageEventContent) -> Self
Source§impl From<ImageEventContent> for ImageEventContentWithoutRelation
impl From<ImageEventContent> for ImageEventContentWithoutRelation
Source§fn from(c: ImageEventContent) -> Self
fn from(c: ImageEventContent) -> Self
Source§impl RedactContent for ImageEventContent
impl RedactContent for ImageEventContent
Source§type Redacted = RedactedImageEventContent
type Redacted = RedactedImageEventContent
Source§fn redact(self, version: &RoomVersionId) -> RedactedImageEventContent
fn redact(self, version: &RoomVersionId) -> RedactedImageEventContent
self
into a redacted form (removing most or all fields) according to the spec. Read more