Trait CommandProvider

Source
pub trait CommandProvider: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn commands<'life0, 'life1, 'async_trait>(
        &'life0 self,
        context: &'life1 ProjectContext,
    ) -> Pin<Box<dyn Future<Output = RazResult<Vec<Command>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn priority(&self) -> u8 { ... }
    fn can_handle(&self, context: &ProjectContext) -> bool { ... }
}
Expand description

Trait for implementing command providers

Required Methods§

Source

fn name(&self) -> &str

Unique name for this provider

Source

fn commands<'life0, 'life1, 'async_trait>( &'life0 self, context: &'life1 ProjectContext, ) -> Pin<Box<dyn Future<Output = RazResult<Vec<Command>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Generate commands for the given context

Provided Methods§

Source

fn priority(&self) -> u8

Priority for this provider (higher = more important)

Source

fn can_handle(&self, context: &ProjectContext) -> bool

Whether this provider can handle the given context

Implementors§