ohos_drawing_sys/error_code/
error_code_ffi.rs

1// automatically generated by rust-bindgen 0.71.1
2
3#![allow(non_upper_case_globals)]
4#![allow(non_camel_case_types)]
5#![allow(non_snake_case)]
6use crate::types::*;
7
8pub type DrawingResult = Result<(), DrawingErrorCode>;
9#[cfg(feature = "api-12")]
10#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
11impl DrawingErrorCode {
12    /// Permission verification failed.
13    pub const NO_PERMISSION: DrawingErrorCode =
14        DrawingErrorCode(const { core::num::NonZero::new(201).unwrap() });
15    /// Invalid input parameter. For example, the pointer in the parameter is a nullptr.
16    pub const INVALID_PARAMETER: DrawingErrorCode =
17        DrawingErrorCode(const { core::num::NonZero::new(401).unwrap() });
18    /// The parameter is not in the valid range.
19    pub const PARAMETER_OUT_OF_RANGE: DrawingErrorCode =
20        DrawingErrorCode(const { core::num::NonZero::new(26200001).unwrap() });
21    /// mem allocate failed.
22    ///
23    /// Available since API-level: 13
24    #[cfg(feature = "api-13")]
25    #[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
26    pub const ALLOCATION_FAILED: DrawingErrorCode =
27        DrawingErrorCode(const { core::num::NonZero::new(26200002).unwrap() });
28}
29#[repr(transparent)]
30/// Enumerates error codes of drawing.
31///
32/// Available since API-level: 12
33#[cfg(feature = "api-12")]
34#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
35#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
36pub struct DrawingErrorCode(pub core::num::NonZero<::core::ffi::c_uint>);
37extern "C" {
38    /// Obtains the error code of the drawing module.
39    ///
40    ///
41    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
42    ///
43    /// # Returns
44    ///
45    /// * Returns the error code.
46    ///
47    /// Available since API-level: 12
48    ///
49    /// Version: 1.0
50    #[cfg(feature = "api-12")]
51    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
52    pub fn OH_Drawing_ErrorCodeGet() -> DrawingResult;
53    /// Resets the error code of the drawing module to OH_DRAWING_SUCCESS.
54    ///
55    ///
56    /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
57    ///
58    /// Available since API-level: 18
59    ///
60    /// Version: 1.0
61    #[cfg(feature = "api-18")]
62    #[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
63    pub fn OH_Drawing_ErrorCodeReset();
64}