[][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>)

Implementations

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]

👎 Deprecated:

Renamed into_object per rust api design guidelines (may be removed in v0.12)

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

Trait Implementations

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

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

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

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

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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

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

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

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

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.