Skip to main content

Device

Trait Device 

Source
pub trait Device:
    Debug
    + Send
    + Sync
    + 'static {
    // Required method
    fn fd(&self) -> &File;

    // Provided methods
    fn get_info(&self) -> Result<VfioDeviceInfo> { ... }
    fn get_region_info(&self, index: u32) -> Result<VfioRegionInfo> { ... }
    fn get_irq_info(&self, index: u32) -> Result<VfioIrqInfo> { ... }
    fn set_irqs<const N: usize>(&self, irq: &VfioIrqSet<N>) -> Result<()> { ... }
    fn disable_all_irqs(&self, index: VfioPciIrq) -> Result<()> { ... }
    fn reset(&self) -> Result<()> { ... }
    fn read(&self, offset: u64, size: u8) -> Result<u64> { ... }
    fn write(&self, offset: u64, size: u8, val: u64) -> Result<()> { ... }
}

Required Methods§

Source

fn fd(&self) -> &File

Provided Methods§

Source

fn get_info(&self) -> Result<VfioDeviceInfo>

Source

fn get_region_info(&self, index: u32) -> Result<VfioRegionInfo>

Source

fn get_irq_info(&self, index: u32) -> Result<VfioIrqInfo>

Source

fn set_irqs<const N: usize>(&self, irq: &VfioIrqSet<N>) -> Result<()>

Source

fn disable_all_irqs(&self, index: VfioPciIrq) -> Result<()>

Source

fn reset(&self) -> Result<()>

Source

fn read(&self, offset: u64, size: u8) -> Result<u64>

Source

fn write(&self, offset: u64, size: u8, val: u64) -> Result<()>

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§