BackendEntry

Trait BackendEntry 

Source
pub trait BackendEntry<Entry, Error> {
    // Required methods
    fn get<'life0, 'async_trait>(
        &'life0 self,
        id: Id,
    ) -> Pin<Box<dyn Future<Output = Result<Existing<Entry>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn all<'life0, 'async_trait>(
        &'life0 self,
        cursor: Id,
        limit: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Existing<Entry>>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn create<'life0, 'async_trait>(
        &'life0 self,
        data: New<Entry>,
    ) -> Pin<Box<dyn Future<Output = Result<Id, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update<'life0, 'async_trait>(
        &'life0 self,
        data: Existing<Entry>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn remove<'life0, 'async_trait>(
        &'life0 self,
        id: Id,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A database entry, or something that can be stored and retrieved from a database.

Required Methods§

Source

fn get<'life0, 'async_trait>( &'life0 self, id: Id, ) -> Pin<Box<dyn Future<Output = Result<Existing<Entry>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get an entity of type with a specific id.

Source

fn all<'life0, 'async_trait>( &'life0 self, cursor: Id, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Existing<Entry>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get all entities of type using offset cursor

Source

fn create<'life0, 'async_trait>( &'life0 self, data: New<Entry>, ) -> Pin<Box<dyn Future<Output = Result<Id, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create a new entity of type.

Source

fn update<'life0, 'async_trait>( &'life0 self, data: Existing<Entry>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Update an entity of type’s data.

Source

fn remove<'life0, 'async_trait>( &'life0 self, id: Id, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Remove a entity of type.

Implementors§