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.
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 deviceid
: A unique identifier for the devicecompatible
: A list of compatibility strings that describe compatible driversresources
: 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
);
Sourcepub fn new(
name: &'static str,
id: usize,
compatible: Vec<&'static str>,
resources: Vec<PlatformDeviceResource>,
) -> Self
pub fn new( name: &'static str, id: usize, compatible: Vec<&'static str>, resources: Vec<PlatformDeviceResource>, ) -> Self
Sourcepub fn get_resources(&self) -> &Vec<PlatformDeviceResource>
pub fn get_resources(&self) -> &Vec<PlatformDeviceResource>
Get the PlatformDeviceResource
associated with the device.
§Returns
A reference to a vector of PlatformDeviceResource
objects.