safer_ffi/utils/
prelude.rs

1#![cfg_attr(rustfmt, rustfmt::skip)]
2#![allow(unused_imports)]
3
4pub(in crate) use crate::{
5    layout::macros::*,
6    c_char,
7    layout::*,
8    tuple::*,
9    utils::markers::*,
10};
11
12pub(in crate) use ::core::{
13    convert::{TryFrom, TryInto},
14    ffi::c_void,
15    fmt,
16    marker::PhantomData,
17    mem,
18    ops::{
19        Deref, DerefMut,
20        Not as _,
21    },
22};
23
24match_cfg! {
25    target_arch = "wasm32" => {
26        #[allow(bad_style, dead_code)]
27        pub(in crate) type size_t = u32;
28    },
29    _ => {
30        pub(in crate) use crate::libc::size_t;
31    },
32}
33
34cfg_alloc! {
35    pub(in crate) use ::alloc::{
36        borrow::ToOwned,
37        string::ToString,
38        vec,
39    };
40}
41
42pub(in crate)
43mod rust {
44    #[apply(cfg_alloc)]
45    pub(in crate) use ::alloc::{
46        boxed::Box,
47        string::String,
48        vec::Vec,
49    };
50}
51
52pub(in crate)
53mod ptr {
54    pub(in crate) use ::core::ptr::*;
55    pub(in crate) use crate::ptr::*;
56}
57
58#[apply(cfg_std)]
59pub(in crate) use ::std::{
60    io,
61};
62
63pub(in crate)
64use crate::prelude::*;