musli_zerocopy/pointer/
mod.rs

1//! Pointer-like types that can be used directly in [`ZeroCopy`] structs.
2//!
3//! Pointers are types which points to data inside of a [`Buf`], and can be used
4//! in combination with methods such as [`Buf::load`] to load the pointer into a
5//! reference.
6//!
7//! * [`Ref<T>`] is a simple pointer to a typed reference, where `T` implements
8//!   [`ZeroCopy`]. It loads into `&T`.
9//! * [`Ref<[T]>`] is a wide pointer encoding both a plain pointer and a length
10//!   where `T` implements [`ZeroCopy`]. It loads into `&[T]`.
11//! * [`Ref<T>`] where `T: ?Sized` is a wide pointer encoding both a plain
12//!   pointer and a size to a typed reference where `T` implements
13//!   [`UnsizedZeroCopy`]. It loads into `&T` and is implemented by types such
14//!   as `str` and `[u8]`.`
15//!
16//! [`ZeroCopy`]: crate::traits::ZeroCopy
17//! [`UnsizedZeroCopy`]: crate::traits::UnsizedZeroCopy
18//! [`Buf`]: crate::buf::Buf
19//! [`Buf::load`]: crate::buf::Buf::load
20
21#[doc(inline)]
22pub use self::size::{DefaultSize, Size};
23mod size;
24
25#[doc(inline)]
26pub use self::r#ref::Ref;
27mod r#ref;
28
29#[doc(inline)]
30pub use self::pointee::Pointee;
31mod pointee;
32
33pub use self::coerce::Coerce;
34mod coerce;
35
36pub use self::coerce_slice::CoerceSlice;
37mod coerce_slice;