Skip to main content

ContextSource

Trait ContextSource 

Source
pub trait ContextSource: Send + Sync {
    // Required method
    fn load<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Item>, ContextError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A source of context Items.

Implement this trait to create custom context loaders that can be plugged into a ContextLoader. Each call to load should return zero or more Items with ItemKind::Context.

Required Methods§

Source

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

Load context items from this source.

§Errors

Returns ContextError if the underlying filesystem operations fail.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§