#[non_exhaustive]pub struct EmbedField {
pub name: CompactString,
pub value: CompactString,
pub inline: bool,
}Expand description
discord.js counterpart: APIEmbedField.
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 field’s name (max 256 characters).
value: CompactStringThe field’s value (max 1024 characters).
inline: boolWhether the field is shown next to other inline fields.
Implementations§
Source§impl EmbedField
impl EmbedField
Sourcepub fn new(
name: impl Into<CompactString>,
value: impl Into<CompactString>,
inline: bool,
) -> Self
pub fn new( name: impl Into<CompactString>, value: impl Into<CompactString>, inline: bool, ) -> Self
Creates a field named name showing value, next to other inline fields if inline.
Nothing is validated; djs-builders checks Discord’s limits.
discord.js counterpart: EmbedField.
§Examples
use djs_model::message::EmbedField;
let field = EmbedField::new("Ping", "42 ms", true);
assert_eq!((field.name.as_str(), field.value.as_str(), field.inline), ("Ping", "42 ms", true));Trait Implementations§
Source§impl Clone for EmbedField
impl Clone for EmbedField
Source§impl Debug for EmbedField
impl Debug for EmbedField
Source§impl<'de> Deserialize<'de> for EmbedField
impl<'de> Deserialize<'de> for EmbedField
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 EmbedField
Source§impl Hash for EmbedField
impl Hash for EmbedField
Source§impl PartialEq for EmbedField
impl PartialEq for EmbedField
Source§impl Serialize for EmbedField
impl Serialize for EmbedField
impl StructuralPartialEq for EmbedField
Auto Trait Implementations§
impl Forget for EmbedField
impl Freeze for EmbedField
impl Move for EmbedField
impl RefUnwindSafe for EmbedField
impl Send for EmbedField
impl Sync for EmbedField
impl Unpin for EmbedField
impl UnsafeUnpin for EmbedField
impl UnwindSafe for EmbedField
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