devela/sys/mem/
mod.rs

1// devela::sys::mem
2//
3//! Memory management.
4#![doc = crate::doc_!(modules: crate::sys; mem: cell)]
5#![doc = crate::doc_!(newline)]
6//!
7#![doc = crate::doc_!(extends: alloc, borrow, boxed, cell, mem, pin, ptr, rc, slice)]
8#![cfg_attr(
9    any(not(feature = "bit")),
10    doc = "## Features\nTo compile the missing items, enable the `bit` feature."
11)]
12//
13// safety
14#![cfg_attr(feature = "safe_mem", forbid(unsafe_code))]
15
16mod aligned; // MemAligned
17mod alloc; // Alloc, ::alloc::alloc::*
18mod borrow; // Mow
19mod cache_align; // CacheAlign
20mod cswap; // cswap!
21mod ext; // ExtMem
22mod namespace; // Mem
23mod pin; // Pinned, ::core::pin::*
24mod ptr; // Ptr, ::core::ptr::*
25mod reexports; // ::core::mem::*
26mod size; // size_of_expr!, BitSized, ByteSized,
27mod slice; // Slice, ExtSlice
28mod storage; // Bare, BareBox, Boxed, Storage
29
30#[cfg(all(not(feature = "safe_mem"), feature = "unsafe_layout"))]
31#[cfg_attr(nightly_doc, doc(cfg(feature = "unsafe_layout")))]
32mod pod; // MemPod
33
34#[cfg(feature = "std")]
35#[cfg(all(not(feature = "safe_mem"), feature = "unsafe_layout"))]
36#[cfg_attr(nightly_doc, doc(cfg(all(feature = "std", feature = "unsafe_layout"))))]
37mod guard; // Current, CurrrentGuard
38
39pub mod cell; // ExtCellOption, ::core::cell::*
40
41crate::items! { // structural access: _mods, _pub_mods, _hidden, _all, _always
42    #[allow(unused)]
43    pub use {_mods::*, _hidden::*};
44    #[allow(unused)] #[doc(hidden, no_inline)]
45    pub use {_always::*, _pub_mods::*};
46
47    mod _mods { #![allow(unused)]
48        pub use super::{
49            aligned::*, alloc::_all::*, borrow::_all::*, cache_align::*, cswap::*, ext::*,
50            namespace::*, pin::_all::*, ptr::_all::*, reexports::*, size::_all::*, slice::_all::*,
51            storage::*,
52        };
53        #[cfg(all(not(feature = "safe_mem"), feature = "unsafe_layout"))]
54        pub use super::pod::MemPod;
55        #[cfg(feature = "std")]
56        #[cfg(all(not(feature = "safe_mem"), feature = "unsafe_layout"))]
57        pub use super::guard::{Current, CurrentGuard};
58    }
59    mod _pub_mods {
60        pub use super::cell::_all::*;
61    }
62    pub(super) mod _hidden {
63        pub use super::size::_hidden::*;
64    }
65    pub(super) mod _all {
66        #[doc(inline)]
67        pub use super::{_mods::*, _pub_mods::*};
68    }
69    pub(super) mod _always { #![allow(unused)]
70        pub use super::{cell::_always::*, pin::_always::*, ptr::_always::*, reexports::*};
71    }
72}