[][src]Struct nanowrimo::data::CollectionResponse

pub struct CollectionResponse<D: ObjectInfo = Object> {
    pub data: Vec<D>,
    pub included: Option<Vec<Object>>,
    pub post_info: Option<Box<PostInfo>>,
}

A successful response from a call to the API which returns multiple items. Is generic over the inner data type, which allows for the case of a known return type to avoid needing an unwrap. Defaults to the generic Object

Fields

data: Vec<D>

The array of returned objects

included: Option<Vec<Object>>

Any included linked objects

post_info: Option<Box<PostInfo>>

Extra info provided for Post objects

Implementations

impl<D: ObjectInfo> CollectionResponse<D>[src]

pub fn get_ref(&self, obj_ref: &ObjectRef) -> Option<&Object>[src]

Find the instance of an ObjectRef in this response's included list, if an instance exists. Otherwise returns None

Trait Implementations

impl<D: Debug + ObjectInfo> Debug for CollectionResponse<D>[src]

impl<'de, D: ObjectInfo> Deserialize<'de> for CollectionResponse<D> where
    D: Deserialize<'de>, 
[src]

impl<D: ObjectInfo> Serialize for CollectionResponse<D> where
    D: Serialize
[src]

Auto Trait Implementations

impl<D> RefUnwindSafe for CollectionResponse<D> where
    D: RefUnwindSafe

impl<D> Send for CollectionResponse<D> where
    D: Send

impl<D> Sync for CollectionResponse<D> where
    D: Sync

impl<D> Unpin for CollectionResponse<D> where
    D: Unpin

impl<D> UnwindSafe for CollectionResponse<D> where
    D: 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> Instrument for T[src]

impl<T> Instrument for T[src]

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.