Struct ruma_common::events::room::message::AudioMessageEventContent
source · pub struct AudioMessageEventContent {
pub body: String,
pub source: MediaSource,
pub info: Option<Box<AudioInfo>>,
pub message: Option<MessageContent>,
pub file: Option<FileContent>,
pub audio: Option<AudioContent>,
pub voice: Option<VoiceContent>,
}events only.Expand description
The payload for an audio message.
With the unstable-msc3246 feature, this type contains the transitional format of
AudioEventContent and with the unstable-msc3245 feature, this type also contains the
transitional format of VoiceEventContent. See the documentation of the message module
for more information.
Fields§
§body: StringThe textual representation of this message.
source: MediaSourceThe source of the audio clip.
info: Option<Box<AudioInfo>>Metadata for the audio clip referred to in source.
message: Option<MessageContent>unstable-msc3246 only.Extensible-event text representation of the message.
If present, this should be preferred over the body field.
file: Option<FileContent>unstable-msc3246 only.Extensible-event file content of the message.
If present, this should be preferred over the source and info fields.
audio: Option<AudioContent>unstable-msc3246 only.Extensible-event audio info of the message.
If present, this should be preferred over the info field.
voice: Option<VoiceContent>unstable-msc3245 only.Extensible-event voice flag of the message.
If present, this should be represented as a voice message.
Implementations§
source§impl AudioMessageEventContent
impl AudioMessageEventContent
sourcepub fn plain(body: String, url: OwnedMxcUri, info: Option<Box<AudioInfo>>) -> Self
pub fn plain(body: String, url: OwnedMxcUri, info: Option<Box<AudioInfo>>) -> Self
Creates a new non-encrypted AudioMessageEventContent 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 AudioMessageEventContent with the given body and encrypted
file.
sourcepub fn from_extensible_voice_content(
message: MessageContent,
file: FileContent,
audio: AudioContent,
voice: VoiceContent
) -> Self
Available on crate feature unstable-msc3245 only.
pub fn from_extensible_voice_content(
message: MessageContent,
file: FileContent,
audio: AudioContent,
voice: VoiceContent
) -> Self
unstable-msc3245 only.Create a new AudioMessageEventContent with the given message, file info, audio info and
voice flag.
Trait Implementations§
source§impl Clone for AudioMessageEventContent
impl Clone for AudioMessageEventContent
source§fn clone(&self) -> AudioMessageEventContent
fn clone(&self) -> AudioMessageEventContent
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more