#[non_exhaustive]pub struct ApplicationRoleConnectionMetadata {
pub kind: MetadataType,
pub key: CompactString,
pub name: CompactString,
pub name_localizations: BTreeMap<Locale, CompactString>,
pub description: CompactString,
pub description_localizations: BTreeMap<Locale, CompactString>,
}Expand description
An application role connection metadata record: one field that guilds can compare against when granting a linked role.
discord.js counterpart: ApplicationRoleConnectionMetadata.
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.kind: MetadataTypeHow the user’s value is compared with the guild’s configured value.
key: CompactStringThe dictionary key of the field (a-z, 0-9 and _; 1-50 characters).
name: CompactStringThe field’s name (1-100 characters).
name_localizations: BTreeMap<Locale, CompactString>Translations of the name, keyed by locale (D-058).
description: CompactStringThe field’s description (1-200 characters).
description_localizations: BTreeMap<Locale, CompactString>Translations of the description, keyed by locale (D-058).
Implementations§
Source§impl ApplicationRoleConnectionMetadata
impl ApplicationRoleConnectionMetadata
Sourcepub fn new(
kind: MetadataType,
key: impl Into<CompactString>,
name: impl Into<CompactString>,
description: impl Into<CompactString>,
) -> Self
pub fn new( kind: MetadataType, key: impl Into<CompactString>, name: impl Into<CompactString>, description: impl Into<CompactString>, ) -> Self
A record without translations.
discord.js counterpart: ApplicationRoleConnectionMetadataEditOptions.
§Examples
use djs_model::application_role_connection_metadata::{
ApplicationRoleConnectionMetadata, MetadataType,
};
let record = ApplicationRoleConnectionMetadata::new(
MetadataType::IntegerGreaterThanOrEqual,
"level",
"Level",
"The player's level",
);
assert_eq!(
serde_json::to_string(&record)?,
r#"{"type":2,"key":"level","name":"Level","description":"The player's level"}"#
);Trait Implementations§
Source§impl<'de> Deserialize<'de> for ApplicationRoleConnectionMetadata
impl<'de> Deserialize<'de> for ApplicationRoleConnectionMetadata
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 ApplicationRoleConnectionMetadata
impl StructuralPartialEq for ApplicationRoleConnectionMetadata
Auto Trait Implementations§
impl Forget for ApplicationRoleConnectionMetadata
impl Freeze for ApplicationRoleConnectionMetadata
impl Move for ApplicationRoleConnectionMetadata
impl RefUnwindSafe for ApplicationRoleConnectionMetadata
impl Send for ApplicationRoleConnectionMetadata
impl Sync for ApplicationRoleConnectionMetadata
impl Unpin for ApplicationRoleConnectionMetadata
impl UnsafeUnpin for ApplicationRoleConnectionMetadata
impl UnwindSafe for ApplicationRoleConnectionMetadata
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