pub enum MsgContent {
Text {
body: String,
formatted_body: Option<String>,
},
Image {
body: String,
source: MediaSource,
info: Option<ImageInfo>,
},
Audio {
body: String,
source: MediaSource,
info: Option<AudioInfo>,
audio: Option<UnstableAudioDetailsContentBlock>,
},
Video {
body: String,
source: MediaSource,
info: Option<VideoInfo>,
},
File {
body: String,
source: MediaSource,
info: Option<FileInfo>,
filename: Option<String>,
},
Location {
body: String,
geo_uri: String,
info: Option<LocationInfo>,
},
Link {
name: Option<String>,
link: String,
},
}
Variants§
Implementations§
Source§impl MsgContent
impl MsgContent
pub fn body(&self) -> String
pub fn formatted_body(&self) -> Option<String>
pub fn source(&self) -> Option<MediaSource>
pub fn mimetype(&self) -> Option<String>
pub fn size(&self) -> Option<u64>
pub fn width(&self) -> Option<u64>
pub fn height(&self) -> Option<u64>
pub fn thumbnail_source(&self) -> Option<MediaSource>
pub fn thumbnail_info(&self) -> Option<ThumbnailInfo>
pub fn duration(&self) -> Option<u64>
pub fn blurhash(&self) -> Option<String>
pub fn filename(&self) -> Option<String>
pub fn geo_uri(&self) -> Option<String>
pub fn link(&self) -> Option<String>
Trait Implementations§
Source§impl Clone for MsgContent
impl Clone for MsgContent
Source§fn clone(&self) -> MsgContent
fn clone(&self) -> MsgContent
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 MsgContent
impl Debug for MsgContent
Source§impl<'de> Deserialize<'de> for MsgContent
impl<'de> Deserialize<'de> for MsgContent
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
Source§impl From<&AudioMessageEventContent> for MsgContent
impl From<&AudioMessageEventContent> for MsgContent
Source§fn from(value: &AudioMessageEventContent) -> Self
fn from(value: &AudioMessageEventContent) -> Self
Converts to this type from the input type.
Source§impl From<&EmoteMessageEventContent> for MsgContent
impl From<&EmoteMessageEventContent> for MsgContent
Source§fn from(value: &EmoteMessageEventContent) -> Self
fn from(value: &EmoteMessageEventContent) -> Self
Converts to this type from the input type.
Source§impl From<&FileMessageEventContent> for MsgContent
impl From<&FileMessageEventContent> for MsgContent
Source§fn from(value: &FileMessageEventContent) -> Self
fn from(value: &FileMessageEventContent) -> Self
Converts to this type from the input type.
Source§impl From<&ImageMessageEventContent> for MsgContent
impl From<&ImageMessageEventContent> for MsgContent
Source§fn from(value: &ImageMessageEventContent) -> Self
fn from(value: &ImageMessageEventContent) -> Self
Converts to this type from the input type.
Source§impl From<&LocationMessageEventContent> for MsgContent
impl From<&LocationMessageEventContent> for MsgContent
Source§fn from(value: &LocationMessageEventContent) -> Self
fn from(value: &LocationMessageEventContent) -> Self
Converts to this type from the input type.
Source§impl From<&TextMessageEventContent> for MsgContent
impl From<&TextMessageEventContent> for MsgContent
Source§fn from(value: &TextMessageEventContent) -> Self
fn from(value: &TextMessageEventContent) -> Self
Converts to this type from the input type.
Source§impl From<&VideoMessageEventContent> for MsgContent
impl From<&VideoMessageEventContent> for MsgContent
Source§fn from(value: &VideoMessageEventContent) -> Self
fn from(value: &VideoMessageEventContent) -> Self
Converts to this type from the input type.
Source§impl From<TextMessageEventContent> for MsgContent
impl From<TextMessageEventContent> for MsgContent
Source§fn from(value: TextMessageEventContent) -> Self
fn from(value: TextMessageEventContent) -> Self
Converts to this type from the input type.
Source§impl Serialize for MsgContent
impl Serialize for MsgContent
Source§impl TryFrom<&AttachmentContent> for MsgContent
impl TryFrom<&AttachmentContent> for MsgContent
Auto Trait Implementations§
impl Freeze for MsgContent
impl RefUnwindSafe for MsgContent
impl Send for MsgContent
impl Sync for MsgContent
impl Unpin for MsgContent
impl UnwindSafe for MsgContent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more