Trait async_hal::Interrupt

source ·
pub trait Interrupt {
    type Error;

    // Required methods
    fn enable(&mut self) -> Result<(), Self::Error>;
    fn disable(&mut self) -> Result<(), Self::Error>;
    fn poll_interrupt(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>
    ) -> Poll<Result<(), Self::Error>>;

    // Provided methods
    fn poll_interrupt_unpin(
        &mut self,
        cx: &mut Context<'_>
    ) -> Poll<Result<(), Self::Error>>
       where Self: Unpin { ... }
    fn interrupts(&mut self) -> Interrupts<'_, Self>
       where Self: Unpin { ... }
}

Required Associated Types§

Required Methods§

source

fn enable(&mut self) -> Result<(), Self::Error>

source

fn disable(&mut self) -> Result<(), Self::Error>

source

fn poll_interrupt( self: Pin<&mut Self>, cx: &mut Context<'_> ) -> Poll<Result<(), Self::Error>>

Provided Methods§

source

fn poll_interrupt_unpin( &mut self, cx: &mut Context<'_> ) -> Poll<Result<(), Self::Error>>where Self: Unpin,

source

fn interrupts(&mut self) -> Interrupts<'_, Self>where Self: Unpin,

Enable the interrupt and return a [Stream] of events. This will disable the interrupt on drop.

Implementors§