Closed sukyoungjeong-furiosa closed 2 years ago
이 PR은 Device 구조체를 통해 sysfs로부터 가져올 수 있는 metadata 종류를 추가하고, #31 과 같이 lazy read를 지원합니다. (resolves #31)
크게 다음 부분이 변했습니다.
pub(crate) static MGMT_FILES: &[(&str, bool)] = &[ (ALIVE, false), // lazy read (ATR_ERROR, false), // lazy read (BUSNAME, true), // read at initialization ...
pub struct Device { device_info: DeviceInfo, hwmon_fetcher: hwmon::Fetcher, pub(crate) cores: Vec<CoreIdx>, pub(crate) dev_files: Vec<DeviceFile>, }
pub struct DeviceInfo { device_index: u8, dev_root: PathBuf, sys_root: PathBuf, meta: DeviceMetadata, }
pub(crate) struct DeviceMetadata { pub(crate) arch: Arch, pub(crate) map: HashMap<&'static str, String>, }
머지하겠습니다. 수고하셨습니다.
이 PR은 Device 구조체를 통해 sysfs로부터 가져올 수 있는 metadata 종류를 추가하고, #31 과 같이 lazy read를 지원합니다. (resolves #31)
크게 다음 부분이 변했습니다.
pub struct DeviceInfo { device_index: u8, dev_root: PathBuf, sys_root: PathBuf, meta: DeviceMetadata, }
pub(crate) struct DeviceMetadata { pub(crate) arch: Arch, pub(crate) map: HashMap<&'static str, String>, }