#[non_exhaustive]pub struct DynamicField {
pub name: CompactString,
pub value: DynamicFieldValue,
}Expand description
A custom stat field: a name and a typed value.
discord.js counterpart: APIApplicationIdentityProfileDynamicField (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 field’s name (max 100 characters).
value: DynamicFieldValueThe field’s value.
Implementations§
Source§impl DynamicField
impl DynamicField
Sourcepub fn new(name: impl Into<CompactString>, value: DynamicFieldValue) -> Self
pub fn new(name: impl Into<CompactString>, value: DynamicFieldValue) -> Self
Creates a field.
discord.js counterpart: APIApplicationIdentityProfileDynamicField (discord-api-types).
Trait Implementations§
Source§impl Clone for DynamicField
impl Clone for DynamicField
Source§impl Debug for DynamicField
impl Debug for DynamicField
Source§impl<'de> Deserialize<'de> for DynamicField
impl<'de> Deserialize<'de> for DynamicField
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DynamicField
impl PartialEq for DynamicField
Source§impl Serialize for DynamicField
impl Serialize for DynamicField
impl StructuralPartialEq for DynamicField
Auto Trait Implementations§
impl Freeze for DynamicField
impl RefUnwindSafe for DynamicField
impl Send for DynamicField
impl Sync for DynamicField
impl Unpin for DynamicField
impl UnsafeUnpin for DynamicField
impl UnwindSafe for DynamicField
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