ohos-init-binding 0.1.0

OpenHarmony's init binding for rust
Documentation
1
2
3
4
5
6
7
8
use std::ffi::CString;

/// check cap can be used, implement with canIUse
#[allow(non_snake_case)]
pub fn canIUse(cap: &str) -> bool {
    let c_cap = CString::new(cap).expect("Create c_string failed");
    unsafe { ohos_init_sys::canIUse(c_cap.as_ptr().cast()) }
}