pub enum MessageElement {
Show 34 variants
Text {
text: String,
},
At {
id: String,
name: Option<String>,
role: Option<String>,
at_type: Option<String>,
},
Sharp {
id: String,
name: Option<String>,
},
Image {
src: String,
title: Option<String>,
width: Option<u32>,
height: Option<u32>,
cache: Option<bool>,
timeout: Option<String>,
},
Audio {
src: String,
title: Option<String>,
duration: Option<u64>,
poster: Option<String>,
cache: Option<bool>,
timeout: Option<String>,
},
Video {
src: String,
title: Option<String>,
duration: Option<u64>,
poster: Option<String>,
width: Option<u32>,
height: Option<u32>,
cache: Option<bool>,
timeout: Option<String>,
},
File {
src: String,
name: Option<String>,
poster: Option<String>,
cache: Option<bool>,
timeout: Option<String>,
},
Quote {
id: String,
forward: Option<bool>,
children: Vec<MessageElement>,
},
Author {
id: String,
name: Option<String>,
avatar: Option<String>,
},
Message {
id: Option<String>,
forward: Option<bool>,
children: Vec<MessageElement>,
},
Bold {
children: Vec<MessageElement>,
},
Italic {
children: Vec<MessageElement>,
},
Underline {
children: Vec<MessageElement>,
},
Strikethrough {
children: Vec<MessageElement>,
},
Spoiler {
children: Vec<MessageElement>,
},
Code {
children: Vec<MessageElement>,
},
Superscript {
children: Vec<MessageElement>,
},
Subscript {
children: Vec<MessageElement>,
},
LineBreak,
Paragraph {
children: Vec<MessageElement>,
},
Link {
href: String,
children: Vec<MessageElement>,
},
ListItem {
children: Vec<MessageElement>,
},
UnorderedList {
children: Vec<MessageElement>,
},
OrderedList {
start: Option<u64>,
reversed: Option<bool>,
list_type: Option<String>,
children: Vec<MessageElement>,
},
Table {
children: Vec<MessageElement>,
},
TableHead {
children: Vec<MessageElement>,
},
TableBody {
children: Vec<MessageElement>,
},
TableFoot {
children: Vec<MessageElement>,
},
TableRow {
children: Vec<MessageElement>,
},
TableHeader {
children: Vec<MessageElement>,
},
TableCell {
children: Vec<MessageElement>,
},
Button {
id: Option<String>,
theme: Option<String>,
href: Option<String>,
text: Option<String>,
disabled: Option<bool>,
children: Vec<MessageElement>,
},
Span {
style: Option<String>,
children: Vec<MessageElement>,
},
Div {
style: Option<String>,
children: Vec<MessageElement>,
},
}Variants§
Text
文本
At
提及用户
Fields
Sharp
提及频道
Image
图片
Fields
Audio
音频
Fields
Video
视频
Fields
File
文件
Fields
Quote
引用
Author
作者
Message
消息
Bold
粗体
Fields
§
children: Vec<MessageElement>Italic
斜体
Fields
§
children: Vec<MessageElement>Underline
下划线
Fields
§
children: Vec<MessageElement>Strikethrough
删除线
Fields
§
children: Vec<MessageElement>Spoiler
剧透
Fields
§
children: Vec<MessageElement>Code
代码
Fields
§
children: Vec<MessageElement>Superscript
上标
Fields
§
children: Vec<MessageElement>Subscript
下标
Fields
§
children: Vec<MessageElement>LineBreak
换行
Paragraph
段落
Fields
§
children: Vec<MessageElement>Link
链接
ListItem
Fields
§
children: Vec<MessageElement>UnorderedList
Fields
§
children: Vec<MessageElement>OrderedList
Fields
§
children: Vec<MessageElement>Table
Fields
§
children: Vec<MessageElement>TableHead
Fields
§
children: Vec<MessageElement>TableBody
Fields
§
children: Vec<MessageElement>TableFoot
Fields
§
children: Vec<MessageElement>TableRow
Fields
§
children: Vec<MessageElement>TableHeader
Fields
§
children: Vec<MessageElement>TableCell
Fields
§
children: Vec<MessageElement>Button
Fields
§
children: Vec<MessageElement>Span
Div
Trait Implementations§
Source§impl Clone for MessageElement
impl Clone for MessageElement
Source§fn clone(&self) -> MessageElement
fn clone(&self) -> MessageElement
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 MessageElement
impl Debug for MessageElement
Source§impl<'de> Deserialize<'de> for MessageElement
impl<'de> Deserialize<'de> for MessageElement
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
Auto Trait Implementations§
impl Freeze for MessageElement
impl RefUnwindSafe for MessageElement
impl Send for MessageElement
impl Sync for MessageElement
impl Unpin for MessageElement
impl UnsafeUnpin for MessageElement
impl UnwindSafe for MessageElement
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