#[non_exhaustive]pub struct TextDisplay {
pub id: Option<i32>,
pub content: CompactString,
}Expand description
A text display: markdown text, like a message’s content (messages and modals).
discord.js counterpart: TextDisplayComponent / TextDisplayBuilder.
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.id: Option<i32>The component’s numeric identifier (generated by Discord when not set).
content: CompactStringThe markdown text.
Implementations§
Source§impl TextDisplay
impl TextDisplay
Sourcepub fn new(content: impl Into<CompactString>) -> Self
pub fn new(content: impl Into<CompactString>) -> Self
Creates a text display.
discord.js counterpart: TextDisplayBuilder (@discordjs/builders).
Trait Implementations§
Source§impl Clone for TextDisplay
impl Clone for TextDisplay
Source§impl Debug for TextDisplay
impl Debug for TextDisplay
impl Eq for TextDisplay
Source§impl From<TextDisplay> for Component
impl From<TextDisplay> for Component
Source§fn from(component: TextDisplay) -> Self
fn from(component: TextDisplay) -> Self
Converts to this type from the input type.
Source§impl PartialEq for TextDisplay
impl PartialEq for TextDisplay
Source§impl Serialize for TextDisplay
impl Serialize for TextDisplay
impl StructuralPartialEq for TextDisplay
Auto Trait Implementations§
impl Forget for TextDisplay
impl Freeze for TextDisplay
impl Move for TextDisplay
impl RefUnwindSafe for TextDisplay
impl Send for TextDisplay
impl Sync for TextDisplay
impl Unpin for TextDisplay
impl UnsafeUnpin for TextDisplay
impl UnwindSafe for TextDisplay
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