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<ImageEventContentWithoutRelation>>,
}Available on crate features
events and unstable-msc3552 only.Expand description
Fields§
§message: MessageContentThe text representation of the message.
file: FileContentThe 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<ImageEventContentWithoutRelation>>Information about related messages.
Implementations§
source§impl 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.
Trait Implementations§
source§impl Clone for ImageEventContent
impl Clone for ImageEventContent
source§fn clone(&self) -> ImageEventContent
fn clone(&self) -> ImageEventContent
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 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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl EventContent for ImageEventContent
impl EventContent for ImageEventContent
§type EventType = MessageLikeEventType
type EventType = MessageLikeEventType
The Rust enum for the event kind’s known types.
source§fn event_type(&self) -> Self::EventType
fn event_type(&self) -> Self::EventType
Get the event’s type, like
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
Converts to this type from the input type.
source§impl From<ImageEventContent> for ImageEventContentWithoutRelation
impl From<ImageEventContent> for ImageEventContentWithoutRelation
source§fn from(c: ImageEventContent) -> Self
fn from(c: ImageEventContent) -> Self
Converts to this type from the input type.
source§impl RedactContent for ImageEventContent
impl RedactContent for ImageEventContent
§type Redacted = RedactedImageEventContent
type Redacted = RedactedImageEventContent
The redacted form of the event’s content.
source§fn redact(self, version: &RoomVersionId) -> RedactedImageEventContent
fn redact(self, version: &RoomVersionId) -> RedactedImageEventContent
Transform
self into a redacted form (removing most or all fields) according to the spec. Read more