AssetHandler

Trait AssetHandler 

Source
pub trait AssetHandler {
    // Required methods
    fn insert_asset<'life0, 'life1, 'async_trait>(
        &'life0 self,
        asset: &'life1 Asset,
    ) -> Pin<Box<dyn Future<Output = Result<usize, DataError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn insert_asset_if_new<'life0, 'life1, 'async_trait>(
        &'life0 self,
        asset: &'life1 Asset,
        rename_asset: bool,
    ) -> Pin<Box<dyn Future<Output = Result<usize, DataError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_asset_id<'life0, 'life1, 'async_trait>(
        &'life0 self,
        asset: &'life1 Asset,
    ) -> Pin<Box<dyn Future<Output = Option<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_asset_by_id<'life0, 'async_trait>(
        &'life0 self,
        id: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Asset, DataError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_asset_by_isin<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Asset, DataError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_all_assets<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Asset>, DataError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_asset<'life0, 'life1, 'async_trait>(
        &'life0 self,
        asset: &'life1 Asset,
    ) -> Pin<Box<dyn Future<Output = Result<(), DataError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete_asset<'life0, 'async_trait>(
        &'life0 self,
        id: usize,
    ) -> Pin<Box<dyn Future<Output = Result<(), DataError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_all_currencies<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Currency>, DataError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Handler for globally available data of transactions and related data

Required Methods§

Source

fn insert_asset<'life0, 'life1, 'async_trait>( &'life0 self, asset: &'life1 Asset, ) -> Pin<Box<dyn Future<Output = Result<usize, DataError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn insert_asset_if_new<'life0, 'life1, 'async_trait>( &'life0 self, asset: &'life1 Asset, rename_asset: bool, ) -> Pin<Box<dyn Future<Output = Result<usize, DataError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_asset_id<'life0, 'life1, 'async_trait>( &'life0 self, asset: &'life1 Asset, ) -> Pin<Box<dyn Future<Output = Option<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_asset_by_id<'life0, 'async_trait>( &'life0 self, id: usize, ) -> Pin<Box<dyn Future<Output = Result<Asset, DataError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_asset_by_isin<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Asset, DataError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_all_assets<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Asset>, DataError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return a list of all assets ordered by name

Source

fn update_asset<'life0, 'life1, 'async_trait>( &'life0 self, asset: &'life1 Asset, ) -> Pin<Box<dyn Future<Output = Result<(), DataError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Source

fn get_all_currencies<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Currency>, DataError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

We assume here that a currency is an Asset with a three letter name and no ISIN nor WKN

Implementors§