#[non_exhaustive]pub struct EmbedAuthor {
pub name: CompactString,
pub url: Option<CompactString>,
pub icon_url: Option<CompactString>,
pub proxy_icon_url: Option<CompactString>,
}Expand description
The author of an embed.
discord.js counterpart: APIEmbedAuthor (discord-api-types).
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.name: CompactStringThe author’s name (max 256 characters).
url: Option<CompactString>The URL the name links to (http(s) only).
icon_url: Option<CompactString>The URL of the author icon (http(s) or attachment://).
proxy_icon_url: Option<CompactString>The URL of the icon through Discord’s media proxy.
Implementations§
Source§impl EmbedAuthor
impl EmbedAuthor
Sourcepub fn new(name: impl Into<CompactString>) -> Self
pub fn new(name: impl Into<CompactString>) -> Self
Creates an author named name, with no URL and no icon.
Nothing is validated; djs-builders checks Discord’s limits.
discord.js counterpart: EmbedAuthorOptions (@discordjs/builders).
§Examples
use djs_model::message::EmbedAuthor;
let author = EmbedAuthor::new("djs-rs");
assert_eq!(author.name, "djs-rs");
assert_eq!(author.url, None);Trait Implementations§
Source§impl Clone for EmbedAuthor
impl Clone for EmbedAuthor
Source§impl Debug for EmbedAuthor
impl Debug for EmbedAuthor
Source§impl<'de> Deserialize<'de> for EmbedAuthor
impl<'de> Deserialize<'de> for EmbedAuthor
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
impl Eq for EmbedAuthor
Source§impl Hash for EmbedAuthor
impl Hash for EmbedAuthor
Source§impl PartialEq for EmbedAuthor
impl PartialEq for EmbedAuthor
Source§impl Serialize for EmbedAuthor
impl Serialize for EmbedAuthor
impl StructuralPartialEq for EmbedAuthor
Auto Trait Implementations§
impl Forget for EmbedAuthor
impl Freeze for EmbedAuthor
impl Move for EmbedAuthor
impl RefUnwindSafe for EmbedAuthor
impl Send for EmbedAuthor
impl Sync for EmbedAuthor
impl Unpin for EmbedAuthor
impl UnsafeUnpin for EmbedAuthor
impl UnwindSafe for EmbedAuthor
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