pub trait DataCollector: Send + Sync {
// Required methods
fn start_collection<'life0, 'async_trait>(
&'life0 self,
task: CollectionTask,
sender: Sender<MarketDataEvent>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn stop_collection<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
exchange: &'life1 str,
symbol: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_status<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
exchange: &'life1 str,
symbol: &'life2 str,
) -> Pin<Box<dyn Future<Output = Option<CollectionStatus>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = FxHashMap<String, CollectionStats>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait for data collection handlers.
Required Methods§
Sourcefn start_collection<'life0, 'async_trait>(
&'life0 self,
task: CollectionTask,
sender: Sender<MarketDataEvent>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start_collection<'life0, 'async_trait>(
&'life0 self,
task: CollectionTask,
sender: Sender<MarketDataEvent>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start collecting data for the specified task.
Sourcefn stop_collection<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
exchange: &'life1 str,
symbol: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn stop_collection<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
exchange: &'life1 str,
symbol: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Stop collecting data for the specified exchange and symbol.
Sourcefn get_status<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
exchange: &'life1 str,
symbol: &'life2 str,
) -> Pin<Box<dyn Future<Output = Option<CollectionStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_status<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
exchange: &'life1 str,
symbol: &'life2 str,
) -> Pin<Box<dyn Future<Output = Option<CollectionStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get current collection status.