1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
use core::{ffi::c_void, mem::MaybeUninit};
#[derive(Clone, Copy)]
#[repr(transparent)]
pub struct Handle(*mut c_void);
impl Handle {
pub(crate) unsafe fn uninitialized() -> Self {
MaybeUninit::zeroed().assume_init()
}
}
#[derive(Clone, Copy)]
#[repr(transparent)]
pub struct Event(*mut c_void);
pub trait Align {
fn alignment() -> usize;
fn assert_aligned(storage: &mut [u8]) {
if !storage.is_empty() {
assert_eq!(
(storage.as_ptr() as usize) % Self::alignment(),
0,
"The provided storage is not correctly aligned for this type"
)
}
}
}
mod guid;
pub use self::guid::Guid;
pub use self::guid::{unsafe_guid, Identify};
pub mod chars;
pub use self::chars::{Char16, Char8};
#[macro_use]
mod enums;
mod strs;
pub use self::strs::{CStr16, CStr8};