Struct kernel::irq::ThreadedRegistration
source · [−]pub struct ThreadedRegistration<H: ThreadedHandler>(_);
Expand description
The registration of a threaded interrupt handler.
Examples
The following is an example of a threaded handler with a ref-counted u32 as data:
use kernel::{
irq,
sync::{Ref, RefBorrow},
};
struct Example;
impl irq::ThreadedHandler for Example {
type Data = Ref<u32>;
fn handle_threaded_irq(_data: RefBorrow<'_, u32>) -> irq::Return {
irq::Return::None
}
}
fn request_irq(irq: u32, data: Ref<u32>) -> Result<irq::ThreadedRegistration<Example>> {
irq::ThreadedRegistration::try_new(irq, data, irq::flags::SHARED, fmt!("example_{irq}"))
}
Implementations
Auto Trait Implementations
impl<H> RefUnwindSafe for ThreadedRegistration<H> where
<H as ThreadedHandler>::Data: RefUnwindSafe,
impl<H> !Send for ThreadedRegistration<H>
impl<H> !Sync for ThreadedRegistration<H>
impl<H> Unpin for ThreadedRegistration<H> where
<H as ThreadedHandler>::Data: Unpin,
impl<H> UnwindSafe for ThreadedRegistration<H> where
<H as ThreadedHandler>::Data: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more