Skip to main content

FetchInto

Trait FetchInto 

Source
pub trait FetchInto<T>: Sized {
    // Required methods
    fn fetch_into(&self, client: &Client) -> Result<T>;
    fn a_fetch_into<'life0, 'life1, 'async_trait>(
        &'life0 self,
        client: &'life1 Client,
    ) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>
       where T: 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A trait indicating that this type can be converted into another by fetching from the API. Note that FetchFrom should be implemented, in order to apply the respective blanket implementation of this trait.

Required Methods§

Source

fn fetch_into(&self, client: &Client) -> Result<T>

(Sync) Attempts to request to the API and return a new instance of the type being turned into.

§Errors

See the respective into-type’s fetch implementation (or PropFetchable/PropLimFetchable implementation).

§Examples

See FetchFrom::<T>::fetch_from.

Source

fn a_fetch_into<'life0, 'life1, 'async_trait>( &'life0 self, client: &'life1 Client, ) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>
where T: 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

(Async) Attempts to request to the API and return a new instance of the type being turned into.

§Errors

See the respective into-type’s a_fetch implementation (or PropFetchable/PropLimFetchable implementation).

§Examples

See FetchFrom::<T>::a_fetch_from.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T, U> FetchInto<U> for T
where T: Sync + Send, U: FetchFrom<T> + Sync + Send,