Struct PlatformDeviceInfo

Source
pub struct PlatformDeviceInfo {
    name: &'static str,
    id: usize,
    compatible: Vec<&'static str>,
    resources: Vec<PlatformDeviceResource>,
}
Expand description

Struct representing platform device information.

Fields§

§name: &'static str§id: usize§compatible: Vec<&'static str>§resources: Vec<PlatformDeviceResource>

Implementations§

Source§

impl PlatformDeviceInfo

Information about a platform device.

This structure holds the basic identifying information for platform devices, including a name, unique identifier, compatibility strings, and resources.

§Fields

  • name: A static string representing the name of the device
  • id: A unique identifier for the device
  • compatible: A list of compatibility strings that describe compatible drivers
  • resources: A list of resources associated with the device

§Examples

let device_info = PlatformDeviceInfo::new(
    "uart0",
    0,
    vec!["ns16550a", "uart"],
    Vec::new() // Add resources as an empty vector
);
Source

pub fn new( name: &'static str, id: usize, compatible: Vec<&'static str>, resources: Vec<PlatformDeviceResource>, ) -> Self

Creates a new PlatformDeviceInfo instance.

§Arguments
  • name - Static string identifier for the device
  • id - Unique identifier number
  • compatible - List of compatible device identifiers
§Returns

A new PlatformDeviceInfo instance with the provided values.

Source

pub fn get_resources(&self) -> &Vec<PlatformDeviceResource>

Get the PlatformDeviceResource associated with the device.

§Returns

A reference to a vector of PlatformDeviceResource objects.

Trait Implementations§

Source§

impl DeviceInfo for PlatformDeviceInfo

Source§

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

Source§

fn id(&self) -> usize

Source§

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

Source§

fn as_any(&self) -> &dyn Any

Auto Trait Implementations§

§

impl Freeze for PlatformDeviceInfo

§

impl RefUnwindSafe for PlatformDeviceInfo

§

impl Send for PlatformDeviceInfo

§

impl Sync for PlatformDeviceInfo

§

impl Unpin for PlatformDeviceInfo

§

impl UnwindSafe for PlatformDeviceInfo

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.