Struct ruma::events::image::ImageEventContent
source · 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<ImageEventContentWithoutRelation>>,
}
Available on crate features
events
and unstable-msc3552
only.Expand description
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<ImageEventContentWithoutRelation>>
Information about related messages.
Implementations§
source§impl 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.
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<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>,
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) -> <ImageEventContent as EventContent>::EventType
fn event_type(&self) -> <ImageEventContent as EventContent>::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) -> AnyMessageLikeEventContent
fn from(c: ImageEventContent) -> AnyMessageLikeEventContent
Converts to this type from the input type.
source§impl From<ImageEventContent> for ImageEventContentWithoutRelation
impl From<ImageEventContent> for ImageEventContentWithoutRelation
source§fn from(c: ImageEventContent) -> ImageEventContentWithoutRelation
fn from(c: ImageEventContent) -> ImageEventContentWithoutRelation
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 moresource§impl Serialize for ImageEventContent
impl Serialize for ImageEventContent
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more