Trait redact_data::DataStorer[][src]

pub trait DataStorer: Clone + Send + Sync {
    #[must_use]
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<Data, StorageError>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn get_collection<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 str,
        skip: i64,
        page_size: i64
    ) -> Pin<Box<dyn Future<Output = Result<DataCollection, StorageError>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn create<'life0, 'async_trait>(
        &'life0 self,
        data: Data
    ) -> Pin<Box<dyn Future<Output = Result<bool, StorageError>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }

Required methods

#[must_use]
fn get<'life0, 'life1, 'async_trait>(
    &'life0 self,
    path: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Data, StorageError>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fetches one instance of a Data stored at that path. If the Data is an array, the first retrieved element is returned.

#[must_use]
fn get_collection<'life0, 'life1, 'async_trait>(
    &'life0 self,
    path: &'life1 str,
    skip: i64,
    page_size: i64
) -> Pin<Box<dyn Future<Output = Result<DataCollection, StorageError>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fetches all the instances of Data stored at that path. Use this if retrieving an array of Data.

#[must_use]
fn create<'life0, 'async_trait>(
    &'life0 self,
    data: Data
) -> Pin<Box<dyn Future<Output = Result<bool, StorageError>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Serializes a piece of Data to the the database.

Implementors

impl DataStorer for MongoDataStorer[src]

fn get<'life0, 'life1, 'async_trait>(
    &'life0 self,
    path: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Data, StorageError>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

fn get_collection<'life0, 'life1, 'async_trait>(
    &'life0 self,
    path: &'life1 str,
    skip: i64,
    page_size: i64
) -> Pin<Box<dyn Future<Output = Result<DataCollection, StorageError>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

fn create<'life0, 'async_trait>(
    &'life0 self,
    data: Data
) -> Pin<Box<dyn Future<Output = Result<bool, StorageError>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

impl DataStorer for RedactDataStorer[src]

fn get<'life0, 'life1, 'async_trait>(
    &'life0 self,
    path: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Data, StorageError>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

fn get_collection<'life0, 'life1, 'async_trait>(
    &'life0 self,
    path: &'life1 str,
    skip: i64,
    page_size: i64
) -> Pin<Box<dyn Future<Output = Result<DataCollection, StorageError>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

fn create<'life0, 'async_trait>(
    &'life0 self,
    data: Data
) -> Pin<Box<dyn Future<Output = Result<bool, StorageError>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]