pub struct FileMessageEventContent {
pub body: String,
pub filename: Option<String>,
pub source: MediaSource,
pub info: Option<Box<FileInfo, Global>>,
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: String
A 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: MediaSource
The source of the file.
info: Option<Box<FileInfo, Global>>
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
sourceimpl FileMessageEventContent
impl FileMessageEventContent
sourcepub fn plain(
body: String,
url: OwnedMxcUri,
info: Option<Box<FileInfo, Global>>
) -> FileMessageEventContent
pub fn plain(
body: String,
url: OwnedMxcUri,
info: Option<Box<FileInfo, Global>>
) -> FileMessageEventContent
Creates a new non-encrypted FileMessageEventContent
with the given body, url and
optional extra info.
sourcepub fn encrypted(body: String, file: EncryptedFile) -> FileMessageEventContent
pub fn encrypted(body: String, file: EncryptedFile) -> FileMessageEventContent
Creates a new encrypted FileMessageEventContent
with the given body and encrypted
file.
Trait Implementations
sourceimpl Clone for FileMessageEventContent
impl Clone for FileMessageEventContent
sourcefn clone(&self) -> FileMessageEventContent
fn clone(&self) -> FileMessageEventContent
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for FileMessageEventContent
impl Debug for FileMessageEventContent
sourceimpl<'de> Deserialize<'de> for FileMessageEventContent
impl<'de> Deserialize<'de> for FileMessageEventContent
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<FileMessageEventContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<FileMessageEventContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
sourceimpl From<FileMessageEventContentDeHelper> for FileMessageEventContent
Available on crate feature unstable-msc3551
only.
impl From<FileMessageEventContentDeHelper> for FileMessageEventContent
unstable-msc3551
only.