Struct Subscription
pub struct Subscription {
pub level: u64,
pub billing_cycle_anchor: Option<u64>,
pub end_of_current_period: u64,
pub active: bool,
pub cancel_at_period_end: bool,
pub currency: String,
pub amount: u64,
pub status: i32,
pub processor: i32,
pub payment_method: i32,
pub payment_processing: bool,
pub charge_failure: Option<ChargeFailure>,
}Fields§
§level: u64The subscription level
billing_cycle_anchor: Option<u64>If present, UNIX Epoch Timestamp in seconds, can be used to calculate next billing date.
end_of_current_period: u64UNIX Epoch Timestamp in seconds, when the current subscription period ends
active: boolWhether there is a currently active subscription
cancel_at_period_end: boolIf true, an active subscription will not auto-renew at the end of the current period
currency: StringA three-letter ISO 4217 currency code for currency used in the subscription
amount: u64The amount paid for the subscription in the currency’s minor unit
status: i32The subscription’s status, mapped to Stripe’s statuses. trialing will never be returned
processor: i32The payment provider associated with the subscription
payment_method: i32The payment method associated with the subscription
payment_processing: boolWhether the latest charge for the subscription is in a non-terminal state
charge_failure: Option<ChargeFailure>if present, contains information that may be interpreted to help the user fix a failure
Implementations§
§impl Subscription
impl Subscription
pub fn billing_cycle_anchor(&self) -> u64
pub fn billing_cycle_anchor(&self) -> u64
Returns the value of billing_cycle_anchor, or the default value if billing_cycle_anchor is unset.
pub fn status(&self) -> SubscriptionStatus
pub fn status(&self) -> SubscriptionStatus
Returns the enum value of status, or the default if the field is set to an invalid enum value.
pub fn set_status(&mut self, value: SubscriptionStatus)
pub fn set_status(&mut self, value: SubscriptionStatus)
Sets status to the provided enum value.
pub fn processor(&self) -> PaymentProvider
pub fn processor(&self) -> PaymentProvider
Returns the enum value of processor, or the default if the field is set to an invalid enum value.
pub fn set_processor(&mut self, value: PaymentProvider)
pub fn set_processor(&mut self, value: PaymentProvider)
Sets processor to the provided enum value.
pub fn payment_method(&self) -> PaymentMethod
pub fn payment_method(&self) -> PaymentMethod
Returns the enum value of payment_method, or the default if the field is set to an invalid enum value.
pub fn set_payment_method(&mut self, value: PaymentMethod)
pub fn set_payment_method(&mut self, value: PaymentMethod)
Sets payment_method to the provided enum value.
Trait Implementations§
§impl Clone for Subscription
impl Clone for Subscription
§fn clone(&self) -> Subscription
fn clone(&self) -> Subscription
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for Subscription
impl Debug for Subscription
§impl Default for Subscription
impl Default for Subscription
§fn default() -> Subscription
fn default() -> Subscription
impl Eq for Subscription
§impl Hash for Subscription
impl Hash for Subscription
§impl Message for Subscription
impl Message for Subscription
§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.§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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].