pub struct ImageEventContent {
pub message: MessageContent,
pub file: FileContent,
pub image: Box<ImageContent, Global>,
pub thumbnail: Vec<ThumbnailContent, Global>,
pub caption: Option<MessageContent>,
pub relates_to: Option<Relation>,
}
events
and unstable-msc3552
only.Expand description
The payload for an extensible image message.
This is the new primary type introduced in MSC3552 and should not be sent before the end of
the transition period. See the documentation of the message
module for more information.
ImageEventContent
can be converted to a RoomMessageEventContent
with a
MessageType::Image
. You can convert it back with
ImageEventContent::from_image_room_message()
.
Fields
message: MessageContent
The text representation of the message.
file: FileContent
The file content of the message.
image: Box<ImageContent, Global>
The image content of the message.
thumbnail: Vec<ThumbnailContent, Global>
The thumbnails of the message.
The captions of the message.
relates_to: Option<Relation>
Information about related messages.
Implementations
sourceimpl ImageEventContent
impl ImageEventContent
sourcepub fn plain(message: impl Into<String>, file: FileContent) -> ImageEventContent
pub fn plain(message: impl Into<String>, file: FileContent) -> ImageEventContent
Creates a new ImageEventContent
with the given plain text message and file.
sourcepub fn with_message(
message: MessageContent,
file: FileContent
) -> ImageEventContent
pub fn with_message(
message: MessageContent,
file: FileContent
) -> ImageEventContent
Creates a new non-encrypted ImageEventContent
with the given message and file.
sourcepub fn from_image_room_message(
content: ImageMessageEventContent,
relates_to: Option<Relation>
) -> ImageEventContent
pub fn from_image_room_message(
content: ImageMessageEventContent,
relates_to: Option<Relation>
) -> ImageEventContent
Create a new ImageEventContent
from the given ImageMessageEventContent
and optional
relation.
Trait Implementations
sourceimpl Clone for ImageEventContent
impl Clone for ImageEventContent
sourcefn clone(&self) -> ImageEventContent
fn clone(&self) -> ImageEventContent
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for ImageEventContent
impl Debug for ImageEventContent
sourceimpl<'de> Deserialize<'de> for ImageEventContent
impl<'de> Deserialize<'de> for ImageEventContent
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<ImageEventContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<ImageEventContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
sourceimpl EventContent for ImageEventContent
impl EventContent for ImageEventContent
type EventType = MessageLikeEventType
type EventType = MessageLikeEventType
sourcefn event_type(&self) -> <ImageEventContent as EventContent>::EventType
fn event_type(&self) -> <ImageEventContent as EventContent>::EventType
m.room.message
.sourceimpl From<ImageEventContent> for AnyMessageLikeEventContent
impl From<ImageEventContent> for AnyMessageLikeEventContent
sourcefn from(c: ImageEventContent) -> AnyMessageLikeEventContent
fn from(c: ImageEventContent) -> AnyMessageLikeEventContent
sourceimpl From<ImageEventContent> for RoomMessageEventContent
impl From<ImageEventContent> for RoomMessageEventContent
sourcefn from(content: ImageEventContent) -> RoomMessageEventContent
fn from(content: ImageEventContent) -> RoomMessageEventContent
sourceimpl RedactContent for ImageEventContent
impl RedactContent for ImageEventContent
type Redacted = RedactedImageEventContent
type Redacted = RedactedImageEventContent
sourcefn 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