FetchStrategy

Trait FetchStrategy 

Source
pub trait FetchStrategy {
    // Required methods
    fn name(&self) -> &'static str;
    fn fetch_channel<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        client: &'life1 Client,
        channel_name: &'life2 str,
        config: &'life3 StrategyConfig,
    ) -> Pin<Box<dyn Future<Output = FetchResult<ChannelInfo>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;

    // Provided method
    fn is_enabled(&self, _config: &StrategyConfig) -> bool { ... }
}
Expand description

Base strategy trait for all fetching approaches

Required Methods§

Source

fn name(&self) -> &'static str

Get the name of this strategy

Source

fn fetch_channel<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, client: &'life1 Client, channel_name: &'life2 str, config: &'life3 StrategyConfig, ) -> Pin<Box<dyn Future<Output = FetchResult<ChannelInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Fetch channel information using this strategy

Provided Methods§

Source

fn is_enabled(&self, _config: &StrategyConfig) -> bool

Check if this strategy is available/enabled

Implementors§