[−][src]Enum stripe::Expandable
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"])
Variants
Id(T::Id)
Object(Box<T>)
Methods
impl<T> Expandable<T> where
T: Object,
T::Id: Clone,
[src]
T: Object,
T::Id: Clone,
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]
T::Id: Clone,
fn clone(&self) -> Expandable<T>
[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]
T::Id: Debug,
impl<T: Object> Serialize for Expandable<T> where
T: Serialize,
T::Id: Serialize,
[src]
T: Serialize,
T::Id: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de, T: Object> Deserialize<'de> for Expandable<T> where
T: Deserialize<'de>,
T::Id: Deserialize<'de>,
[src]
T: Deserialize<'de>,
T::Id: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl<T> Send for Expandable<T> where
T: Send,
<T as Object>::Id: Send,
T: Send,
<T as Object>::Id: Send,
impl<T> Sync for Expandable<T> where
T: Sync,
<T as Object>::Id: Sync,
T: Sync,
<T as Object>::Id: Sync,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self