pub trait Interface: DriverGeneric {
// Required methods
fn create_queue(&mut self) -> Option<Box<dyn IQueue>>;
fn enable_irq(&mut self);
fn disable_irq(&mut self);
fn is_irq_enabled(&self) -> bool;
fn handle_irq(&mut self) -> Event;
}Expand description
Operations that require a block storage device driver to implement.
This trait defines the core interface that all block device drivers must implement to work with the rdrive framework. It provides methods for queue management, interrupt handling, and device lifecycle operations.
Required Methods§
fn create_queue(&mut self) -> Option<Box<dyn IQueue>>
Sourcefn enable_irq(&mut self)
fn enable_irq(&mut self)
Enable interrupts for the device.
After calling this method, the device will generate interrupts for completed operations and other events.
Sourcefn disable_irq(&mut self)
fn disable_irq(&mut self)
Disable interrupts for the device.
After calling this method, the device will not generate interrupts. This is useful during critical sections or device shutdown.
Sourcefn is_irq_enabled(&self) -> bool
fn is_irq_enabled(&self) -> bool
Check if interrupts are currently enabled.
Returns true if interrupts are enabled, false otherwise.
Sourcefn handle_irq(&mut self) -> Event
fn handle_irq(&mut self) -> Event
Handles an IRQ from the device, returning an event if applicable.
This method should be called from the device’s interrupt handler. It processes the interrupt and returns information about which queues have completed operations.