pub struct Cache {
pub spec_dirs: Vec<String>,
pub specs: HashMap<String, Vec<Spec>>,
pub devices: HashMap<String, Device>,
pub errors: HashMap<String, Vec<Box<dyn Error + Send + Sync + 'static>>>,
pub dir_errors: HashMap<String, Box<dyn Error + Send + Sync + 'static>>,
pub auto_refresh: bool,
}Fields§
§spec_dirs: Vec<String>§specs: HashMap<String, Vec<Spec>>§devices: HashMap<String, Device>§errors: HashMap<String, Vec<Box<dyn Error + Send + Sync + 'static>>>§dir_errors: HashMap<String, Box<dyn Error + Send + Sync + 'static>>§auto_refresh: boolImplementations§
Source§impl Cache
impl Cache
pub fn new( spec_dirs: Vec<String>, specs: HashMap<String, Vec<Spec>>, devices: HashMap<String, Device>, ) -> Self
pub fn configure(&mut self, options: Vec<CdiOption>)
pub fn get_device(&mut self, dev_name: &str) -> Option<&Device>
pub fn list_devices(&mut self) -> Vec<String>
pub fn list_vendors(&mut self) -> Vec<String>
pub fn get_vendor_specs(&mut self, vendor: &str) -> Vec<Spec>
pub fn refresh(&mut self) -> Result<(), Box<dyn Error>>
pub fn inject_devices( &mut self, oci_spec: Option<&mut Spec>, devices: Vec<String>, ) -> Result<Vec<String>, Box<dyn Error + Send + Sync + 'static>>
pub fn get_errors(&self) -> HashMap<String, Vec<Error>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Cache
impl !RefUnwindSafe for Cache
impl Send for Cache
impl Sync for Cache
impl Unpin for Cache
impl !UnwindSafe for Cache
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