pub trait MaybeStubFloppyDiskController:
    Sized
    + ChipsetDevice
    + ChangeDeviceState
    + InspectMut
    + PollDevice
    + PortIoIntercept
    + SaveRestore {
    type NewError: Error + Send + Sync + 'static;

    // Required methods
    fn new(
        guest_memory: GuestMemory,
        interrupt: LineInterrupt,
        register_pio: &mut dyn RegisterPortIoIntercept,
        pio_base_addr: u16,
        disk_drive: DriveRibbon,
        dma: Box<dyn IsaDmaChannel>,
    ) -> Result<Self, Self::NewError>;
    fn offset_of(&self, io_port: u16) -> Option<u16>;
}
Expand description

Trait that abstracts over different floppy controller implementations.

This trait allows re-using the same code for both the fully-featured floppy controller, and the stub floppy controller (which is required when booting via BIOS using the Microsoft PCAT firmware blob).

Required Associated Types§

source

type NewError: Error + Send + Sync + 'static

Error type returned by new()

Required Methods§

source

fn new( guest_memory: GuestMemory, interrupt: LineInterrupt, register_pio: &mut dyn RegisterPortIoIntercept, pio_base_addr: u16, disk_drive: DriveRibbon, dma: Box<dyn IsaDmaChannel>, ) -> Result<Self, Self::NewError>

Create a new FloppyDiskController

source

fn offset_of(&self, io_port: u16) -> Option<u16>

Return the offset of the given IO port, if it is handled by this device.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl MaybeStubFloppyDiskController for FloppyDiskController

source§

type NewError = NewFloppyDiskControllerError

source§

fn new( guest_memory: GuestMemory, interrupt: LineInterrupt, register_pio: &mut dyn RegisterPortIoIntercept, pio_base_addr: u16, disk_drive: DriveRibbon, dma: Box<dyn IsaDmaChannel>, ) -> Result<Self, Self::NewError>

source§

fn offset_of(&self, io_port: u16) -> Option<u16>

source§

impl MaybeStubFloppyDiskController for StubFloppyDiskController

source§

type NewError = Infallible

source§

fn new( _guest_memory: GuestMemory, interrupt: LineInterrupt, register_pio: &mut dyn RegisterPortIoIntercept, pio_base_addr: u16, _disk_drive: DriveRibbon, _dma: Box<dyn IsaDmaChannel>, ) -> Result<Self, Self::NewError>

source§

fn offset_of(&self, io_port: u16) -> Option<u16>

Implementors§