ohos_window_sys/native_window/buffer_handle/
buffer_handle_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)]
6
7#[repr(C)]
8#[derive(Default)]
9pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
10impl<T> __IncompleteArrayField<T> {
11    #[inline]
12    pub const fn new() -> Self {
13        __IncompleteArrayField(::core::marker::PhantomData, [])
14    }
15    #[inline]
16    pub fn as_ptr(&self) -> *const T {
17        self as *const _ as *const T
18    }
19    #[inline]
20    pub fn as_mut_ptr(&mut self) -> *mut T {
21        self as *mut _ as *mut T
22    }
23    #[inline]
24    pub unsafe fn as_slice(&self, len: usize) -> &[T] {
25        ::core::slice::from_raw_parts(self.as_ptr(), len)
26    }
27    #[inline]
28    pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
29        ::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
30    }
31}
32impl<T> ::core::fmt::Debug for __IncompleteArrayField<T> {
33    fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34        fmt.write_str("__IncompleteArrayField")
35    }
36}
37/// Buffer handle used to transfer and obtain information about the buffer.
38///
39/// Available since API-level: 8
40#[repr(C)]
41#[derive(Debug)]
42pub struct BufferHandle {
43    /// < buffer fd, -1 if not supported
44    pub fd: i32,
45    /// < the width of memory
46    pub width: i32,
47    /// < the stride of memory
48    pub stride: i32,
49    /// < the height of memory
50    pub height: i32,
51    pub size: i32,
52    /// < the format of memory
53    pub format: i32,
54    /// < the usage of memory
55    pub usage: u64,
56    /// < Virtual address of memory
57    pub virAddr: *mut ::core::ffi::c_void,
58    /// < Shared memory key
59    pub key: i32,
60    /// < Physical address
61    pub phyAddr: u64,
62    /// < the number of reserved fd value
63    pub reserveFds: u32,
64    /// < the number of reserved integer value
65    pub reserveInts: u32,
66    /// < the data
67    pub reserve: __IncompleteArrayField<i32>,
68}