Struct ruma_common::events::image::ImageEventContent
source · [−]pub struct ImageEventContent {
pub message: MessageContent,
pub file: FileContent,
pub image: Box<ImageContent>,
pub thumbnail: Vec<ThumbnailContent>,
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>
The image content of the message.
thumbnail: Vec<ThumbnailContent>
The thumbnails of the message.
caption: Option<MessageContent>
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) -> Self
pub fn plain(message: impl Into<String>, file: FileContent) -> Self
Creates a new ImageEventContent
with the given plain text message and file.
sourcepub fn with_message(message: MessageContent, file: FileContent) -> Self
pub fn with_message(message: MessageContent, file: FileContent) -> Self
Creates a new non-encrypted ImageEventContent
with the given message and file.
sourcepub fn from_image_room_message(
content: ImageMessageEventContent,
relates_to: Option<Relation>
) -> Self
pub fn from_image_room_message(
content: ImageMessageEventContent,
relates_to: Option<Relation>
) -> Self
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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
sourceimpl EventContent for ImageEventContent
impl EventContent for ImageEventContent
type EventType = MessageLikeEventType
type EventType = MessageLikeEventType
sourcefn event_type(&self) -> Self::EventType
fn event_type(&self) -> Self::EventType
m.room.message
.sourceimpl From<ImageEventContent> for AnyMessageLikeEventContent
impl From<ImageEventContent> for AnyMessageLikeEventContent
sourcefn from(c: ImageEventContent) -> Self
fn from(c: ImageEventContent) -> Self
sourceimpl From<ImageEventContent> for RoomMessageEventContent
impl From<ImageEventContent> for RoomMessageEventContent
sourcefn from(content: ImageEventContent) -> Self
fn from(content: ImageEventContent) -> Self
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