pub struct UdevHwdb { /* private fields */ }Expand description
Represents the on-disk hardware database.
Retrieves properties from the hardware database.
Implementations§
Source§impl UdevHwdb
impl UdevHwdb
Sourcepub const fn header(&self) -> &TrieHeader
pub const fn header(&self) -> &TrieHeader
Gets a reference to the TrieHeader.
Sourcepub fn get_properties_list_entry(
&mut self,
modalias: &str,
_flags: u32,
) -> Option<&UdevEntry>
pub fn get_properties_list_entry( &mut self, modalias: &str, _flags: u32, ) -> Option<&UdevEntry>
Looks up a matching device in the hardware database.
Parameters:
modalias: modalias stringflags: (unused), preserved for easier mapping tolibudevC API
From the libudev documentation:
The lookup key is a `modalias` string, whose formats are defined for the Linux kernel modules.
Examples are: pci:v00008086d00001C2D*, usb:v04F2pB221*. The first entry
of a list of retrieved properties is returned.Returns: an optional reference to an UdevEntry.
Sourcepub fn query(&mut self, modalias: &str) -> Option<&UdevList>
pub fn query(&mut self, modalias: &str) -> Option<&UdevList>
Looks up a matching device modalias in the hardware database and returns the list of properties.
Sourcepub const fn properties_list(&self) -> &UdevList
pub const fn properties_list(&self) -> &UdevList
Gets a reference to the properties list.
Sourcepub fn add_property(&mut self, key: &str, value: &str) -> Result<()>
pub fn add_property(&mut self, key: &str, value: &str) -> Result<()>
Adds a key-value pair to the property list.
Sourcepub fn parse_nodes<'a>(
head: &'a TrieHeader,
hwdb_buf: &'a [u8],
) -> impl Iterator<Item = TrieEntry> + 'a
pub fn parse_nodes<'a>( head: &'a TrieHeader, hwdb_buf: &'a [u8], ) -> impl Iterator<Item = TrieEntry> + 'a
Parses all TrieEntry nodes from an in-memory HWDB buffer.
Auto Trait Implementations§
impl Freeze for UdevHwdb
impl RefUnwindSafe for UdevHwdb
impl Send for UdevHwdb
impl Sync for UdevHwdb
impl Unpin for UdevHwdb
impl UnwindSafe for UdevHwdb
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more