Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§