#[non_exhaustive]pub struct Subscription {
pub id: SubscriptionId,
pub user_id: UserId,
pub sku_ids: Vec<SkuId>,
pub entitlement_ids: Vec<EntitlementId>,
pub renewal_sku_ids: Option<Vec<SkuId>>,
pub current_period_start: Timestamp,
pub current_period_end: Timestamp,
pub status: SubscriptionStatus,
pub canceled_at: Option<Timestamp>,
pub country: Option<CompactString>,
}Expand description
A subscription.
Use the Entitlements it grants to decide access;
the subscription only describes the billing period.
discord.js counterpart: Subscription.
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: SubscriptionIdThe subscription’s ID.
user_id: UserIdThe subscribed user.
sku_ids: Vec<SkuId>The SKUs subscribed to.
entitlement_ids: Vec<EntitlementId>The entitlements granted by the subscription.
renewal_sku_ids: Option<Vec<SkuId>>The SKUs the user will be subscribed to at renewal (None if unchanged).
current_period_start: TimestampThe start of the current period.
current_period_end: TimestampThe end of the current period.
status: SubscriptionStatusThe subscription’s status.
canceled_at: Option<Timestamp>When the subscription was canceled.
country: Option<CompactString>The ISO 3166-1 alpha-2 country code of the payment source (only with a private
OAuth2 scope).
Trait Implementations§
Source§impl Clone for Subscription
impl Clone for Subscription
Source§impl Debug for Subscription
impl Debug for Subscription
Source§impl<'de> Deserialize<'de> for Subscription
impl<'de> Deserialize<'de> for Subscription
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 Subscription
Source§impl From<SubscriptionCreate> for Subscription
impl From<SubscriptionCreate> for Subscription
Source§fn from(event: SubscriptionCreate) -> Self
fn from(event: SubscriptionCreate) -> Self
Converts to this type from the input type.
Source§impl From<SubscriptionDelete> for Subscription
impl From<SubscriptionDelete> for Subscription
Source§fn from(event: SubscriptionDelete) -> Self
fn from(event: SubscriptionDelete) -> Self
Converts to this type from the input type.
Source§impl From<SubscriptionUpdate> for Subscription
impl From<SubscriptionUpdate> for Subscription
Source§fn from(event: SubscriptionUpdate) -> Self
fn from(event: SubscriptionUpdate) -> Self
Converts to this type from the input type.
Source§impl Hash for Subscription
impl Hash for Subscription
Source§impl PartialEq for Subscription
impl PartialEq for Subscription
Source§impl Serialize for Subscription
impl Serialize for Subscription
impl StructuralPartialEq for Subscription
Auto Trait Implementations§
impl Forget for Subscription
impl Freeze for Subscription
impl Move for Subscription
impl RefUnwindSafe for Subscription
impl Send for Subscription
impl Sync for Subscription
impl Unpin for Subscription
impl UnsafeUnpin for Subscription
impl UnwindSafe for Subscription
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