Expand description
Ohos-sys
This crate provides Raw FFI bindings to the native API of OpenHarmonyOS (target_env = "ohos"
).
Each module corresponds to one OpenHarmony API feature, and is gated behind a cargo feature.
If you are an application developer, you probably do not want to use this crate directly,
and instead want to use a higher-level API built on top of this crate.
Note: There are currently still quite a few missing bindings, which will slowly be added.
§Feature flags
arkui
— Enables bindings to the native ArkUI module. Re-exports thearkui-sys
library.deviceinfo
— Enables bindings todeviceinfo.h
. Re-exportsohos-deviceinfo-sys
drawing
— Enables bindings tonative_drawing
. Re-exportsohos-drawing-sys
.hilog
— Enables bindings tohilog
hitrace
— Enables bindings tohitrace
inputmethod
— Enables bindings toinputmethod
from the IME-Kit. Empty if API-level < 12.image-kit
— Bindings to the Image Kitnapi
— Enables bindings tonapi
native_buffer
— Enables bindings tonative_buffer
native_image
— Enables bindings tonative_image
native_window
— Enables bindings tonative_window
vsync
— Enables bindings tonative_vsync
xcomponent
— Enables bindings tonative_xcomponent
all-components
— Enables all components listed above. Orthogonal toapi-XX
features.
§OpenHarmony API level
This crate by default exposes bindings for API-level 10.
Optionally enable one of the api-*
features to get access to bindings for newer
OpenHarmony versions.
api-10
(enabled by default) — No effect. API-10 bindings can’t be deselected. The feature exists for internal purposes.api-11
— Enables bindings for OpenHarmony API-level 11api-12
— Enables bindings for OpenHarmony API-level 12api-13
— Enables bindings for OpenHarmony API-level 13api-14
— Enables bindings for OpenHarmony API-level 13
§Features of dependencies
Re-exports features of individual component crates of ohos-sys
.
In general, it is recommended to depend on the individual component crates
§Internal features
document-features
— Document available features when building the documentation
Re-exports§
pub use arkui_sys as arkui;
arkui
pub use ohos_deviceinfo_sys as deviceinfo;
deviceinfo
pub use ohos_drawing_sys as drawing;
drawing
pub use hilog_sys as hilog;
hilog
pub use hitrace_sys as hitrace;
hitrace
pub use ohos_vsync_sys as vsync;
vsync
pub use xcomponent_sys as xcomponent;
xcomponent
Modules§
- napi
napi
- native_
buffer native_buffer
- Native Buffer bindings
- native_
image native_image
- Bindings to
native_image
- native_
window native_window
- Native Window bindings
- syscap
- Bindings to check a devices system capabilites at runtime