MCPcopy Create free account
hub / github.com/bendudson/EuraliOS / find

Method find

pci/src/main.rs:73–86  ·  view source on GitHub ↗
(&self, vendor_id: u16, device_id:u16)

Source from the content-addressed store, hash-verified

71 }
72
73 fn find(&self, vendor_id: u16, device_id:u16) -> Option<PciLocation> {
74 println!("[pci] Finding device [{:04X}:{:04X}]",
75 vendor_id, device_id);
76
77 if let Some((_key, device)) = self.devices.iter().find(
78 |&(_key, d)| {
79 let d = d.read();
80 d.vendor_id == vendor_id &&
81 d.device_id == device_id}) {
82 Some(device.read().location)
83 } else {
84 None
85 }
86 }
87}
88
89impl DirLike for DeviceCollection {

Callers 2

mainFunction · 0.45
open_pathFunction · 0.45

Calls 2

iterMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected