PciDeviceDriver

Struct PciDeviceDriver 

Source
pub struct PciDeviceDriver {
    name: &'static str,
    id_table: Vec<PciDeviceId>,
    probe_fn: fn(&PciDeviceInfo) -> Result<(), &'static str>,
    remove_fn: fn(&PciDeviceInfo) -> Result<(), &'static str>,
}
Expand description

PCI device driver

Implements the DeviceDriver trait for PCI devices.

Fields§

§name: &'static str

Driver name

§id_table: Vec<PciDeviceId>

List of PCI device IDs this driver supports

§probe_fn: fn(&PciDeviceInfo) -> Result<(), &'static str>

Probe function

§remove_fn: fn(&PciDeviceInfo) -> Result<(), &'static str>

Remove function

Implementations§

Source§

impl PciDeviceDriver

Source

pub fn new( name: &'static str, id_table: Vec<PciDeviceId>, probe_fn: fn(&PciDeviceInfo) -> Result<(), &'static str>, remove_fn: fn(&PciDeviceInfo) -> Result<(), &'static str>, ) -> Self

Create a new PCI device driver

§Arguments
  • name - Driver name
  • id_table - List of supported PCI device IDs
  • probe_fn - Function to probe devices
  • remove_fn - Function to remove devices
Source

pub fn id_table(&self) -> &[PciDeviceId]

Get the device ID table

Source

pub fn matches_device(&self, device: &PciDeviceInfo) -> bool

Check if this driver matches a PCI device

Trait Implementations§

Source§

impl DeviceDriver for PciDeviceDriver

Source§

fn name(&self) -> &'static str

Source§

fn match_table(&self) -> Vec<&'static str>

Source§

fn probe(&self, device: &dyn DeviceInfo) -> Result<(), &'static str>

Source§

fn remove(&self, device: &dyn DeviceInfo) -> Result<(), &'static str>

Auto Trait Implementations§

§

impl Freeze for PciDeviceDriver

§

impl RefUnwindSafe for PciDeviceDriver

§

impl Send for PciDeviceDriver

§

impl Sync for PciDeviceDriver

§

impl Unpin for PciDeviceDriver

§

impl UnwindSafe for PciDeviceDriver

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.