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>>,
}Available on crate feature
events only.Expand description
The payload for a file message.
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.
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
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 FileMessageEventContent
impl Debug for FileMessageEventContent
source§impl<'de> Deserialize<'de> for FileMessageEventContent
impl<'de> Deserialize<'de> for FileMessageEventContent
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