[][src]Trait rabbithole::operation::Fetching

pub trait Fetching {
    type Item: SingleEntity + Send + Sync;
    fn fetch_collection<'life0, 'async_trait>(
        query: &'life0 Query
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::Item>, Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn fetch_single<'life0, 'life1, 'async_trait>(
        id: &'life0 str,
        query: &'life1 Query
    ) -> Pin<Box<dyn Future<Output = Result<Option<Self::Item>, Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
fn fetch_relationship<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        id: &'life0 str,
        related_field: &'life1 str,
        uri: &'life2 str,
        query: &'life3 Query,
        request_path: &'life4 RawUri
    ) -> Pin<Box<dyn Future<Output = Result<Relationship, Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait,
        'life4: 'async_trait
;
fn fetch_related<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        id: &'life0 str,
        related_field: &'life1 str,
        uri: &'life2 str,
        query: &'life3 Query,
        request_path: &'life4 RawUri
    ) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait,
        'life4: 'async_trait
; fn vec_to_document<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        items: &'life0 [Self::Item],
        uri: &'life1 str,
        query: &'life2 Query,
        request_path: &'life3 RawUri
    ) -> Pin<Box<dyn Future<Output = Result<Document, Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait,
        Self: Send + 'async_trait
, { ... } }

Associated Types

Loading content...

Required methods

fn fetch_collection<'life0, 'async_trait>(
    query: &'life0 Query
) -> Pin<Box<dyn Future<Output = Result<Vec<Self::Item>, Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

Mapping to /<ty>?<query>

fn fetch_single<'life0, 'life1, 'async_trait>(
    id: &'life0 str,
    query: &'life1 Query
) -> Pin<Box<dyn Future<Output = Result<Option<Self::Item>, Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 

Mapping to /<ty>/<id>?<query>

fn fetch_relationship<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
    id: &'life0 str,
    related_field: &'life1 str,
    uri: &'life2 str,
    query: &'life3 Query,
    request_path: &'life4 RawUri
) -> Pin<Box<dyn Future<Output = Result<Relationship, Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    'life4: 'async_trait, 

Mapping to /<ty>/<id>/relationships/<related_field>?<query>

Mapping to /<ty>/<id>/<related_field>?<query>

Loading content...

Provided methods

fn vec_to_document<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    items: &'life0 [Self::Item],
    uri: &'life1 str,
    query: &'life2 Query,
    request_path: &'life3 RawUri
) -> Pin<Box<dyn Future<Output = Result<Document, Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    Self: Send + 'async_trait, 

User defined vec_to_document function NOTICE:

  • If using Page Query, it's recommended to:
    • put prev, next, first and last into links
    • put totalPages if @type == PageBased
Loading content...

Implementors

Loading content...