[][src]Crate reffers

Wrappers around references, boxes or Arcs.

Features:

  • ARef: OwningRef with even further erasure of the owner.

  • rc::Strong/Weak/Ref/RefMut: An Rc<RefCell<T>> in just a few bytes of storage, and poisoning support.

  • arc::Strong/Weak/Ref/RefMut: An Arc<Spinlock<T>>- the thread-safe version of the above.

  • RMBA: Wrap a &T, &mut T, Box<T> or Arc<T> within the size of a single pointer.

  • Bx and Bxm: Boxes without DerefMove.

Re-exports

pub use crate::aref::ARef;
pub use crate::aref::ARefs;
pub use crate::aref::ARefss;
pub use crate::rmba::RMBA;

Modules

arc

This is somewhat like an Arc<RwLock<T>>, but with only one usize of overhead, and the lock is a spinlock (there is no wait-and-sleep functionality).

arcu

Type aliases for arc.

aref
rc

An alternative to Rc<RefCell<T>>, with less memory overhead and poisoning support.

rc1

Type aliases for an rc with 1 byte of overhead.

rc2

Type aliases for an rc with 2 bytes of overhead.

rc4

Type aliases for an rc with 4 bytes of overhead.

rc8

Typedefs for an rc with 8 bytes of overhead.

rc16

Typedefs for an rc with 16 bytes of overhead.

rmba

Macros

rc_bit_mask

If you need your own rc with custom overhead, you can invoke this macro for your own type (which is normally a newtype around an integer).

Structs

Bx

A simple wrapper around Box to avoid DerefMove.

Bxm

A simple wrapper around Box to avoid DerefMove. Like Bx, but also allows mutable access to the interior of the box.