pub struct AudioMessageEventContent {
pub body: String,
pub source: MediaSource,
pub info: Option<Box<AudioInfo, Global>>,
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: String
The textual representation of this message.
source: MediaSource
The source of the audio clip.
info: Option<Box<AudioInfo, Global>>
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
sourceimpl AudioMessageEventContent
impl AudioMessageEventContent
sourcepub fn plain(
body: String,
url: OwnedMxcUri,
info: Option<Box<AudioInfo, Global>>
) -> AudioMessageEventContent
pub fn plain(
body: String,
url: OwnedMxcUri,
info: Option<Box<AudioInfo, Global>>
) -> AudioMessageEventContent
Creates a new non-encrypted AudioMessageEventContent
with the given body, url and
optional extra info.
sourcepub fn encrypted(body: String, file: EncryptedFile) -> AudioMessageEventContent
pub fn encrypted(body: String, file: EncryptedFile) -> AudioMessageEventContent
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
) -> AudioMessageEventContent
Available on crate feature unstable-msc3245
only.
pub fn from_extensible_voice_content(
message: MessageContent,
file: FileContent,
audio: AudioContent,
voice: VoiceContent
) -> AudioMessageEventContent
unstable-msc3245
only.Create a new AudioMessageEventContent
with the given message, file info, audio info and
voice flag.
Trait Implementations
sourceimpl Clone for AudioMessageEventContent
impl Clone for AudioMessageEventContent
sourcefn clone(&self) -> AudioMessageEventContent
fn clone(&self) -> AudioMessageEventContent
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for AudioMessageEventContent
impl Debug for AudioMessageEventContent
sourceimpl<'de> Deserialize<'de> for AudioMessageEventContent
impl<'de> Deserialize<'de> for AudioMessageEventContent
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<AudioMessageEventContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<AudioMessageEventContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
sourceimpl From<AudioMessageEventContentDeHelper> for AudioMessageEventContent
Available on crate feature unstable-msc3246
only.
impl From<AudioMessageEventContentDeHelper> for AudioMessageEventContent
unstable-msc3246
only.