#[non_exhaustive]pub enum MsgContent {
Text {
text: String,
undocumented: JsonObject,
},
Link {
text: String,
preview: LinkPreview,
undocumented: JsonObject,
},
Image {
text: String,
image: String,
undocumented: JsonObject,
},
Video {
text: String,
image: String,
duration: i32,
undocumented: JsonObject,
},
Voice {
text: String,
duration: i32,
undocumented: JsonObject,
},
File {
text: String,
undocumented: JsonObject,
},
Report {
text: String,
reason: ReportReason,
undocumented: JsonObject,
},
Chat {
text: String,
chat_link: MsgChatLink,
owner_sig: Option<LinkOwnerSig>,
undocumented: JsonObject,
},
Unknown {
tag: String,
text: String,
json: JsonObject,
undocumented: JsonObject,
},
Undocumented(JsonObject),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
Source§impl MsgContent
impl MsgContent
pub fn make_text(text: String) -> Self
pub fn make_link(text: String, preview: LinkPreview) -> Self
pub fn make_image(text: String, image: String) -> Self
pub fn make_video(text: String, image: String, duration: i32) -> Self
pub fn make_voice(text: String, duration: i32) -> Self
pub fn make_file(text: String) -> Self
pub fn make_report(text: String, reason: ReportReason) -> Self
pub fn make_chat( text: String, chat_link: MsgChatLink, owner_sig: Option<LinkOwnerSig>, ) -> Self
pub fn make_unknown(tag: String, text: String, json: JsonObject) -> Self
Source§impl MsgContent
impl MsgContent
pub fn text(&self) -> Option<&String>
pub fn link(&self) -> Option<MsgContentLinkRef<'_>>
pub fn image(&self) -> Option<MsgContentImageRef<'_>>
pub fn video(&self) -> Option<MsgContentVideoRef<'_>>
pub fn voice(&self) -> Option<MsgContentVoiceRef<'_>>
pub fn file(&self) -> Option<&String>
pub fn report(&self) -> Option<MsgContentReportRef<'_>>
pub fn chat(&self) -> Option<MsgContentChatRef<'_>>
pub fn unknown(&self) -> Option<MsgContentUnknownRef<'_>>
Trait Implementations§
Source§impl Clone for MsgContent
impl Clone for MsgContent
Source§fn clone(&self) -> MsgContent
fn clone(&self) -> MsgContent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PartialEq for MsgContent
impl PartialEq for MsgContent
Source§fn eq(&self, other: &MsgContent) -> bool
fn eq(&self, other: &MsgContent) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for MsgContent
impl Serialize for MsgContent
impl StructuralPartialEq 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 UnsafeUnpin 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