ohos-rdb-sys 0.1.0

Raw bindings to the OpenHarmony relational database (RDB) API
Documentation
// automatically generated by rust-bindgen 0.71.1

#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#[cfg(feature = "api-11")]
use crate::rdb_types::Data_Asset;

/// Define the OH_VBucket structure type.
///
///
/// Available since API-level: 10
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_VBucket {
    /// The id used to uniquely identify the OH_VBucket struct.
    pub id: i64,
    /// Indicates the capability of OH_VBucket.
    pub capability: u16,
    /// Put the const char * value to this [`OH_VBucket`] object for the given column name.
    ///
    /// # Arguments
    ///
    /// * `bucket` - Represents a pointer to an [`OH_VBucket`] instance.
    ///
    /// * `field` - Indicates the name of the column.
    ///
    /// * `value` - Indicates the const char * value.
    ///
    /// # Returns
    ///
    /// * Returns the status code of the execution.
    /// [`OH_VBucket.`]
    /// Available since API-level: 10
    pub putText: ::core::option::Option<
        unsafe extern "C" fn(
            bucket: *mut OH_VBucket,
            field: *const ::core::ffi::c_char,
            value: *const ::core::ffi::c_char,
        ) -> ::core::ffi::c_int,
    >,
    /// Put the int64 value to this [`OH_VBucket`] object for the given column name.
    ///
    /// # Arguments
    ///
    /// * `bucket` - Represents a pointer to an [`OH_VBucket`] instance.
    ///
    /// * `field` - Indicates the name of the column.
    ///
    /// * `value` - Indicates the int64 value.
    ///
    /// # Returns
    ///
    /// * Returns the status code of the execution.
    /// [`OH_VBucket.`]
    /// Available since API-level: 10
    pub putInt64: ::core::option::Option<
        unsafe extern "C" fn(
            bucket: *mut OH_VBucket,
            field: *const ::core::ffi::c_char,
            value: i64,
        ) -> ::core::ffi::c_int,
    >,
    /// Put the double value to this [`OH_VBucket`] object for the given column name.
    ///
    /// # Arguments
    ///
    /// * `bucket` - Represents a pointer to an [`OH_VBucket`] instance.
    ///
    /// * `field` - Indicates the name of the column.
    ///
    /// * `value` - Indicates the double value.
    ///
    /// # Returns
    ///
    /// * Returns the status code of the execution.
    /// [`OH_VBucket.`]
    /// Available since API-level: 10
    pub putReal: ::core::option::Option<
        unsafe extern "C" fn(
            bucket: *mut OH_VBucket,
            field: *const ::core::ffi::c_char,
            value: f64,
        ) -> ::core::ffi::c_int,
    >,
    /// Put the const uint8_t * value to this [`OH_VBucket`] object for the given column name.
    ///
    /// # Arguments
    ///
    /// * `bucket` - Represents a pointer to an [`OH_VBucket`] instance.
    ///
    /// * `field` - Indicates the name of the column.
    ///
    /// * `value` - Indicates the const uint8_t * value.
    ///
    /// * `size` - Indicates the size of value.
    ///
    /// # Returns
    ///
    /// * Returns the status code of the execution.
    /// [`OH_VBucket.`]
    /// Available since API-level: 10
    pub putBlob: ::core::option::Option<
        unsafe extern "C" fn(
            bucket: *mut OH_VBucket,
            field: *const ::core::ffi::c_char,
            value: *const u8,
            size: u32,
        ) -> ::core::ffi::c_int,
    >,
    /// Put NULL to this [`OH_VBucket`] object for the given column name.
    ///
    /// # Arguments
    ///
    /// * `bucket` - Represents a pointer to an [`OH_VBucket`] instance.
    ///
    /// * `field` - Indicates the name of the column.
    ///
    /// # Returns
    ///
    /// * Returns the status code of the execution.
    /// [`OH_VBucket.`]
    /// Available since API-level: 10
    pub putNull: ::core::option::Option<
        unsafe extern "C" fn(
            bucket: *mut OH_VBucket,
            field: *const ::core::ffi::c_char,
        ) -> ::core::ffi::c_int,
    >,
    /// Clear the [`OH_VBucket`] object's values.
    ///
    /// # Arguments
    ///
    /// * `bucket` - Represents a pointer to an [`OH_VBucket`] instance.
    ///
    /// # Returns
    ///
    /// * Returns the status code of the execution.
    /// [`OH_VBucket.`]
    /// Available since API-level: 10
    pub clear:
        ::core::option::Option<unsafe extern "C" fn(bucket: *mut OH_VBucket) -> ::core::ffi::c_int>,
    /// Destroy the [`OH_VBucket`] object and reclaim the memory occupied by the object.
    ///
    /// # Arguments
    ///
    /// * `bucket` - Represents a pointer to an [`OH_VBucket`] instance.
    ///
    /// # Returns
    ///
    /// * Returns the status code of the execution.
    /// [`OH_VBucket.`]
    /// Available since API-level: 10
    pub destroy:
        ::core::option::Option<unsafe extern "C" fn(bucket: *mut OH_VBucket) -> ::core::ffi::c_int>,
}
extern "C" {
    /// Put the [`Data_Asset`] * value to this [`OH_VBucket`] object for the given column name.
    ///
    /// # Arguments
    ///
    /// * `bucket` - Represents a pointer to an [`OH_VBucket`] instance.
    ///
    /// * `field` - Indicates the name of the column.
    ///
    /// * `value` - Indicates the const [`Data_Asset`] * value.
    ///
    /// # Returns
    ///
    /// * Returns the status code of the execution.
    /// [`RDB_OK`] - success.
    /// [`RDB_E_INVALID_ARGS`] - The error code for common invalid args.
    /// [`OH_VBucket.`]
    /// Available since API-level: 11
    #[cfg(feature = "api-11")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
    pub fn OH_VBucket_PutAsset(
        bucket: *mut OH_VBucket,
        field: *const ::core::ffi::c_char,
        value: *mut Data_Asset,
    ) -> ::core::ffi::c_int;
    /// Put the [`Data_Asset`] * value of given count to this [`OH_VBucket`] object for the given column name.
    ///
    /// # Arguments
    ///
    /// * `bucket` - Represents a pointer to an [`OH_VBucket`] instance.
    ///
    /// * `field` - Indicates the name of the column.
    ///
    /// * `value` - Indicates the [`Data_Asset`] value of given count.
    ///
    /// * `count` - Indicates the count of value.
    ///
    /// # Returns
    ///
    /// * Returns the status code of the execution.
    /// [`RDB_OK`] - success.
    /// [`RDB_E_INVALID_ARGS`] - The error code for common invalid args.
    /// [`OH_VBucket.`]
    /// Available since API-level: 11
    #[cfg(feature = "api-11")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
    pub fn OH_VBucket_PutAssets(
        bucket: *mut OH_VBucket,
        field: *const ::core::ffi::c_char,
        value: *mut *mut Data_Asset,
        count: u32,
    ) -> ::core::ffi::c_int;
    /// Put the float vector to the OH_VBucket object.
    ///
    /// # Arguments
    ///
    /// * `bucket` - Represents a pointer to an [`OH_VBucket`] instance.
    ///
    /// * `field` - Represents the name of the column.
    ///
    /// * `vec` - Represents a pointer to float array.
    ///
    /// * `len` - Represents the size of float array.
    ///
    /// # Returns
    ///
    /// * Returns the status code of the execution.
    /// [`RDB_OK`] - success.
    /// [`RDB_E_INVALID_ARGS`] - The error code for common invalid args.
    /// [`OH_VBucket.`]
    /// Available since API-level: 18
    #[cfg(feature = "api-18")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
    pub fn OH_VBucket_PutFloatVector(
        bucket: *mut OH_VBucket,
        field: *const ::core::ffi::c_char,
        vec: *const f32,
        len: usize,
    ) -> ::core::ffi::c_int;
    /// Put the an integer of any length to the OH_VBucket object.
    ///
    /// # Arguments
    ///
    /// * `bucket` - Represents a pointer to an [`OH_VBucket`] instance.
    ///
    /// * `field` - Represents the name of the column.
    ///
    /// * `sign` - Represents 0 is positive integer, 1 is negative integer.
    ///
    /// * `trueForm` - Represents a pointer to integer array.
    ///
    /// * `len` - Represents the size of integer array.
    ///
    /// # Returns
    ///
    /// * Returns the status code of the execution.
    /// [`RDB_OK`] - success.
    /// [`RDB_E_INVALID_ARGS`] - The error code for common invalid args.
    /// [`OH_VBucket.`]
    /// Available since API-level: 18
    #[cfg(feature = "api-18")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
    pub fn OH_VBucket_PutUnlimitedInt(
        bucket: *mut OH_VBucket,
        field: *const ::core::ffi::c_char,
        sign: ::core::ffi::c_int,
        trueForm: *const u64,
        len: usize,
    ) -> ::core::ffi::c_int;
}