Struct matrix_sdk_base::ruma::events::room::message::AudioMessageEventContent
#[non_exhaustive]pub struct AudioMessageEventContent {
pub body: String,
pub source: MediaSource,
pub info: Option<Box<AudioInfo>>,
}
Expand description
The payload for an audio message.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.body: String
The textual representation of this message.
source: MediaSource
The source of the audio clip.
info: Option<Box<AudioInfo>>
Metadata for the audio clip referred to in source
.
Implementations§
§impl AudioMessageEventContent
impl AudioMessageEventContent
pub fn new(body: String, source: MediaSource) -> AudioMessageEventContent
pub fn new(body: String, source: MediaSource) -> AudioMessageEventContent
Creates a new AudioMessageEventContent
with the given body and source.
pub fn plain(body: String, url: OwnedMxcUri) -> AudioMessageEventContent
pub fn plain(body: String, url: OwnedMxcUri) -> AudioMessageEventContent
Creates a new non-encrypted AudioMessageEventContent
with the given bod and url.
pub 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.
pub fn info(
self,
info: impl Into<Option<Box<AudioInfo>>>
) -> AudioMessageEventContent
pub fn info( self, info: impl Into<Option<Box<AudioInfo>>> ) -> AudioMessageEventContent
Creates a new AudioMessageEventContent
from self
with the info
field set to the given
value.
Since the field is public, you can also assign to it directly. This method merely acts as a shorthand for that, because it is very common to set this field.
Trait Implementations§
§impl Clone for AudioMessageEventContent
impl Clone for AudioMessageEventContent
§fn clone(&self) -> AudioMessageEventContent
fn clone(&self) -> AudioMessageEventContent
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 more§impl Debug for AudioMessageEventContent
impl Debug for AudioMessageEventContent
§impl<'de> Deserialize<'de> for AudioMessageEventContent
impl<'de> Deserialize<'de> for AudioMessageEventContent
§fn 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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl MediaEventContent for AudioMessageEventContent
impl MediaEventContent for AudioMessageEventContent
source§fn thumbnail_source(&self) -> Option<MediaSource>
fn thumbnail_source(&self) -> Option<MediaSource>
Get the source of the thumbnail for
Self
. Read more§impl Serialize for AudioMessageEventContent
impl Serialize for AudioMessageEventContent
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for AudioMessageEventContent
impl Send for AudioMessageEventContent
impl Sync for AudioMessageEventContent
impl Unpin for AudioMessageEventContent
impl UnwindSafe for AudioMessageEventContent
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more