Struct ruma_common::events::room::message::FileMessageEventContent
source · pub struct FileMessageEventContent {
pub body: String,
pub filename: Option<String>,
pub source: MediaSource,
pub info: Option<Box<FileInfo>>,
pub message: Option<MessageContent>,
pub file: Option<FileContent>,
}events only.Expand description
The payload for a file message.
With the unstable-msc3551 feature, this type contains the transitional format of
FileEventContent. See the documentation of the message module for more information.
Fields§
§body: StringA human-readable description of the file.
This is recommended to be the filename of the original upload.
filename: Option<String>The original filename of the uploaded file.
source: MediaSourceThe source of the file.
info: Option<Box<FileInfo>>Metadata about the file referred to in source.
message: Option<MessageContent>unstable-msc3551 only.Extensible-event text representation of the message.
If present, this should be preferred over the body field.
file: Option<FileContent>unstable-msc3551 only.Extensible-event file content of the message.
If present, this should be preferred over the source and info fields.
Implementations§
source§impl FileMessageEventContent
impl FileMessageEventContent
sourcepub fn plain(body: String, url: OwnedMxcUri, info: Option<Box<FileInfo>>) -> Self
pub fn plain(body: String, url: OwnedMxcUri, info: Option<Box<FileInfo>>) -> Self
Creates a new non-encrypted FileMessageEventContent with the given body, url and
optional extra info.
sourcepub fn encrypted(body: String, file: EncryptedFile) -> Self
pub fn encrypted(body: String, file: EncryptedFile) -> Self
Creates a new encrypted FileMessageEventContent with the given body and encrypted
file.
Trait Implementations§
source§impl Clone for FileMessageEventContent
impl Clone for FileMessageEventContent
source§fn clone(&self) -> FileMessageEventContent
fn clone(&self) -> FileMessageEventContent
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more