pub struct Subscription {
pub id: String,
pub customer_ref: String,
pub status: SubscriptionStatus,
pub price_ref: Option<String>,
pub quantity: u32,
pub current_period_end: Option<OffsetDateTime>,
pub cancel_at_period_end: bool,
pub metadata: BTreeMap<String, String>,
}Expand description
A recurring subscription as the provider reports it (issue #589).
customer_ref names the customer the way the adapter is configured to name
customers (a provider id, or the venture’s own id where the adapter maps
it); the fields mirror what a billing module reconciles against, never an
entitlement.
Fields§
§id: String§customer_ref: String§status: SubscriptionStatus§price_ref: Option<String>The price the subscription is on (a Stripe Price id), when the provider reports one.
quantity: u32The number of units subscribed. 1 when the provider reports none —
a metered price, for example, has no fixed quantity.
current_period_end: Option<OffsetDateTime>When the current period ends; None when the provider does not say.
cancel_at_period_end: boolWhether the subscription is set to end when the current period does.
metadata: BTreeMap<String, String>The metadata the provider holds on the subscription.
Trait Implementations§
Source§impl Clone for Subscription
impl Clone for Subscription
Source§impl Debug for Subscription
impl Debug for Subscription
impl Eq for Subscription
Source§impl PartialEq for Subscription
impl PartialEq for Subscription
impl StructuralPartialEq for Subscription
Auto Trait Implementations§
impl Freeze 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.