[][src]Enum stripe::Expandable

pub enum Expandable<T: Object> {
    Id(T::Id),
    Object(Box<T>),
}

An id or object.

By default stripe will return an id for most fields, but if more detail is necessary the expand parameter can be provided to ask for the id to be loaded as an object instead:

This example is not tested
Charge::retrieve(&client, &charge_id, &["invoice.customer"])

See https://stripe.com/docs/api/expanding_objects.

Variants

Id(T::Id)Object(Box<T>)

Methods

impl<T> Expandable<T> where
    T: Object,
    T::Id: Clone
[src]

pub fn id(&self) -> T::Id[src]

impl<T: Object> Expandable<T>[src]

pub fn is_object(&self) -> bool[src]

pub fn as_object(&self) -> Option<&T>[src]

pub fn to_object(self) -> Option<T>[src]

Trait Implementations

impl<T: Clone + Object> Clone for Expandable<T> where
    T::Id: Clone
[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: Debug + Object> Debug for Expandable<T> where
    T::Id: Debug
[src]

impl<T: Object> Serialize for Expandable<T> where
    T: Serialize,
    T::Id: Serialize
[src]

impl<'de, T: Object> Deserialize<'de> for Expandable<T> where
    T: Deserialize<'de>,
    T::Id: Deserialize<'de>, 
[src]

Auto Trait Implementations

impl<T> Unpin for Expandable<T> where
    <T as Object>::Id: Unpin

impl<T> Sync for Expandable<T> where
    T: Sync,
    <T as Object>::Id: Sync

impl<T> Send for Expandable<T> where
    T: Send,
    <T as Object>::Id: Send

impl<T> RefUnwindSafe for Expandable<T> where
    T: RefUnwindSafe,
    <T as Object>::Id: RefUnwindSafe

impl<T> UnwindSafe for Expandable<T> where
    T: UnwindSafe,
    <T as Object>::Id: UnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Erased for T

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err

impl<T> Same<T> for T

type Output = T

Should always be Self