From 2eddd0949d76974f97026bde0d0e89e2636e9c61 Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Mon, 4 Apr 2022 16:32:32 +0200 Subject: [PATCH] some docs --- src/lib.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 2c8f9bb..687364c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,7 +9,18 @@ //! * The trait [`StuffingStrategy`] //! * The trait [`Backend`] //! -//! +//! [`StuffedPtr`] is the main type of this crate. You it's a type whose size depends on the +//! choice of [`Backend`] (defaults to `usize`, `u64` and `u128` are also possible). It can store a +//! pointer or some extra data, so you can imagine it being +//! ```rust +//! enum StuffedPtr { +//! Ptr(*mut T), +//! Extra(E), +//! } +//! ``` +//! except that the extra data is bitstuffed into the pointer. You can chose any arbitrary bitstuffing +//! depending on the [`StuffingStrategy`], an unsafe trait that governs how the extra data +//! (or the pointer itself) will be packed into the backend. mod backend; mod strategy;