#[non_exhaustive]pub struct Entitlement {
pub id: EntitlementId,
pub sku_id: SkuId,
pub application_id: ApplicationId,
pub user_id: Option<UserId>,
pub kind: EntitlementType,
pub deleted: bool,
pub starts_at: Option<Timestamp>,
pub ends_at: Option<Timestamp>,
pub guild_id: Option<GuildId>,
pub consumed: bool,
}Expand description
An entitlement.
discord.js counterpart: Entitlement.
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: EntitlementIdThe entitlement’s ID.
sku_id: SkuIdThe SKU it grants access to.
application_id: ApplicationIdThe application the SKU belongs to.
user_id: Option<UserId>The user who has access, for user subscriptions and items.
kind: EntitlementTypeHow the entitlement was obtained.
deleted: boolWhether the entitlement was deleted.
starts_at: Option<Timestamp>When the entitlement becomes valid (None for test entitlements).
ends_at: Option<Timestamp>When the entitlement stops being valid (None for test entitlements).
guild_id: Option<GuildId>The guild that has access, for guild subscriptions.
consumed: boolFor consumable items: whether the entitlement was consumed.
Implementations§
Trait Implementations§
Source§impl Clone for Entitlement
impl Clone for Entitlement
Source§impl Debug for Entitlement
impl Debug for Entitlement
Source§impl<'de> Deserialize<'de> for Entitlement
impl<'de> Deserialize<'de> for Entitlement
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 Entitlement
Source§impl From<EntitlementCreate> for Entitlement
impl From<EntitlementCreate> for Entitlement
Source§fn from(event: EntitlementCreate) -> Self
fn from(event: EntitlementCreate) -> Self
Converts to this type from the input type.
Source§impl From<EntitlementDelete> for Entitlement
impl From<EntitlementDelete> for Entitlement
Source§fn from(event: EntitlementDelete) -> Self
fn from(event: EntitlementDelete) -> Self
Converts to this type from the input type.
Source§impl From<EntitlementUpdate> for Entitlement
impl From<EntitlementUpdate> for Entitlement
Source§fn from(event: EntitlementUpdate) -> Self
fn from(event: EntitlementUpdate) -> Self
Converts to this type from the input type.
Source§impl Hash for Entitlement
impl Hash for Entitlement
Source§impl PartialEq for Entitlement
impl PartialEq for Entitlement
Source§impl Serialize for Entitlement
impl Serialize for Entitlement
impl StructuralPartialEq for Entitlement
Auto Trait Implementations§
impl Freeze for Entitlement
impl RefUnwindSafe for Entitlement
impl Send for Entitlement
impl Sync for Entitlement
impl Unpin for Entitlement
impl UnsafeUnpin for Entitlement
impl UnwindSafe for Entitlement
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