oneapi_rs/info/
platform-info.rs

1//
2// Copyright (C) 2026 Intel Corporation
3//
4// Under the MIT License or the Apache License v2.0.
5// See LICENSE-MIT and LICENSE-APACHE for license information.
6// SPDX-License-Identifier: MIT OR Apache-2.0
7//
8
9use crate::info::Info;
10use crate::platform::Platform;
11use crate::private::Sealed;
12use oneapi_rs_sys::platform::ffi;
13
14/// Returns a backend-defined platform version.
15pub struct Version;
16impl Sealed for Version {}
17impl Info for Version {
18    type Item = String;
19    type Target = Platform;
20    fn get_item(target: &Self::Target) -> Self::Item {
21        ffi::get_version(&target.0)
22    }
23}
24
25/// Returns the name of the platform.
26pub struct Name;
27impl Sealed for Name {}
28impl Info for Name {
29    type Item = String;
30    type Target = Platform;
31    fn get_item(target: &Self::Target) -> Self::Item {
32        ffi::get_name(&target.0)
33    }
34}
35
36/// Returns the name of the vendor providing the platform.
37pub struct Vendor;
38impl Sealed for Vendor {}
39impl Info for Vendor {
40    type Item = String;
41    type Target = Platform;
42    fn get_item(target: &Self::Target) -> Self::Item {
43        ffi::get_vendor(&target.0)
44    }
45}