oneapi_rs/info/
platform-info.rs1use crate::platform::Platform;
10use oneapi_rs_sys::platform::ffi;
11
12pub trait PlatformInfo {
13 type Item;
14 fn get_item(platform: &Platform) -> Self::Item;
15}
16
17pub struct Version;
19impl PlatformInfo for Version {
20 type Item = String;
21 fn get_item(platform: &Platform) -> Self::Item {
22 ffi::get_version(&platform.0)
23 }
24}
25
26pub struct Name;
28impl PlatformInfo for Name {
29 type Item = String;
30 fn get_item(platform: &Platform) -> Self::Item {
31 ffi::get_name(&platform.0)
32 }
33}
34
35pub struct Vendor;
37impl PlatformInfo for Vendor {
38 type Item = String;
39 fn get_item(platform: &Platform) -> Self::Item {
40 ffi::get_vendor(&platform.0)
41 }
42}