sinf 0.1.0

Library for obtaining in-depth system information at both the hardware and software levels
Documentation
#[cfg(all(target_os = "macos", not(feature = "apple-sandbox")))]
fn property(key: &str) -> Option<String> {
    crate::sys::macos::system::get_io_platform_property(key)
}

#[cfg(not(all(target_os = "macos", not(feature = "apple-sandbox"))))]
fn property(_key: &str) -> Option<String> {
    None
}

pub(crate) fn board_id() -> Option<String> {
    property("board-id")
}

pub(crate) fn manufacturer() -> Option<String> {
    property("manufacturer")
}

#[cfg(all(target_os = "macos", not(feature = "apple-sandbox")))]
pub(crate) fn product_name() -> Option<String> {
    property("product-name")
}

pub(crate) fn version() -> Option<String> {
    property("version")
}

#[cfg(all(target_os = "macos", not(feature = "apple-sandbox")))]
pub(crate) fn serial_number() -> Option<String> {
    use objc2_io_kit::kIOPlatformSerialNumberKey;

    let key = std::str::from_utf8(kIOPlatformSerialNumberKey.to_bytes()).ok()?;
    property(key)
}

#[cfg(not(all(target_os = "macos", not(feature = "apple-sandbox"))))]
pub(crate) fn serial_number() -> Option<String> {
    None
}

#[cfg(all(target_os = "macos", not(feature = "apple-sandbox")))]
pub(crate) fn uuid() -> Option<String> {
    use objc2_io_kit::kIOPlatformUUIDKey;

    let key = std::str::from_utf8(kIOPlatformUUIDKey.to_bytes()).ok()?;
    property(key)
}