1// devela::sys::mem::reexports
2//
3//! Reexported items from `core`.
4//
56#[cfg(all(doc, feature = "alloc"))]
7use super::Boxed;
8use crate::reexport;
910#[cfg(feature = "alloc")]
11crate::impl_cdef![<T: ConstDefault> Self::new() => RcWeak<T>];
1213#[doc(inline)]
14pub use crate::Sized;
1516/* borrow */
1718reexport! { rust: core::borrow,
19 doc: "A trait for borrowing data.",
20 Borrow
21}
22reexport! { rust: core::borrow,
23 doc: "A trait for mutably borrowing data.",
24 BorrowMut
25}
26reexport! { rust: alloc::borrow,
27 doc: "A clone-on-write smart pointer.",
28 Cow
29}
30reexport! { rust: alloc::borrow,
31 doc: "A generalization of Clone to borrowed data.",
32 ToOwned
33}
3435/* box */
3637reexport! { rust: alloc::boxed,
38 doc: "A pointer type that uniquely owns a heap allocation of type `T`.
3940It is used as the underlying [`Storage`][super::Storage] for the [`Boxed`] marker struct,
41just as a [`BareBox`][super::BareBox] is used as the storage for [`Bare`].
4243A special magic property of `Box` is that it allows moving with [*boxed], unlike
44other `Deref` types. It is hoped that an eventual `DerefMove` trait will make it
45possible for other types to opt in to move-from-deref.
46",
47 Box
48}
4950/* mem */
5152reexport! { rust: core::mem,
53 doc: "A wrapper to inhibit compiler from automatically calling `T`’s destructor.",
54 ManuallyDrop
55}
56reexport! { rust: core::mem,
57 doc: "A wrapper type to construct uninitialized instances of `T`.",
58 MaybeUninit
59}
60reexport! { rust: core::mem,
61 doc: "Opaque type representing the discriminant of an enum.",
62 Discriminant
63}
6465reexport! { rust: core::mem,
66 doc: "Expands to the offset in bytes of a field from the beginning of the given type.",
67 offset_of
68}
6970// NOTE: can't namespace this in `Mem`.
71reexport! { rust: core::mem,
72 doc: "Reinterprets the bits of a value of one type as another type.",
73 transmute
74}
7576/* pin */
7778reexport! { rust: core::pin,
79 doc: "Constructs a <code>[Pin]<[&mut] T></code>, by pinning a `value: T` locally.",
80 pin
81}
82reexport! { rust: core::pin,
83 doc: "A pointer which pins its pointee in place.",
84 Pin
85}
8687/* rc */
8889reexport! { rust: alloc::rc,
90 doc: "A single-threaded reference-counting pointer.",
91 Rc
92}
93reexport! { rust: alloc::rc,
94 doc: "A version of `Rc` that holds a non-owning reference to the managed allocation.",
95 @Weak as RcWeak
96}