Trait InputOps

Source
pub trait InputOps {
    // Required methods
    fn poll_key<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Key>>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn read_key<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<Key>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Primitive graphical console input operations.

Required Methods§

Source

fn poll_key<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Option<Key>>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the next key press if any is available.

Source

fn read_key<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Key>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Waits for and returns the next key press.

Implementors§