Struct libblkid_rs::BlkidCache
source · pub struct BlkidCache(/* private fields */);
Expand description
Data structure representing cache in libblkid
Implementations§
source§impl BlkidCache
impl BlkidCache
sourcepub fn get_cache(filename: Option<&Path>) -> Result<Self>
pub fn get_cache(filename: Option<&Path>) -> Result<Self>
Allocate and initialize cache handler
Use None for filename to use the default cache path
sourcepub fn iter(&self) -> BlkidDevIter ⓘ
pub fn iter(&self) -> BlkidDevIter ⓘ
Create an iterator from the cached devices
sourcepub fn probe_all_new(&mut self) -> Result<()>
pub fn probe_all_new(&mut self) -> Result<()>
Probe for all new block devices
sourcepub fn probe_all_removable(&mut self) -> Result<()>
pub fn probe_all_removable(&mut self) -> Result<()>
Probe for all removable block devices
sourcepub fn get_dev(&self, devname: &Path, flags: BlkidDevFlags) -> Result<BlkidDev>
pub fn get_dev(&self, devname: &Path, flags: BlkidDevFlags) -> Result<BlkidDev>
Find a device by device name in the cache.
Use the BlkidDevConst::Create
flag to create an empty cache entry.
sourcepub fn get_tag_value(&self, tag_name: &str, devname: &Path) -> Result<String>
pub fn get_tag_value(&self, tag_name: &str, devname: &Path) -> Result<String>
Get the value associated with a tag (e.g. TYPE) for a given device
sourcepub fn get_devname(
&self,
token_or_pair: Either<&str, (&str, &str)>
) -> Result<String>
pub fn get_devname( &self, token_or_pair: Either<&str, (&str, &str)> ) -> Result<String>
Get the device name for a specific NAME=value
tag pair in the cache
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BlkidCache
impl RefUnwindSafe for BlkidCache
impl !Send for BlkidCache
impl !Sync for BlkidCache
impl Unpin for BlkidCache
impl UnwindSafe for BlkidCache
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