Skip to main content Crate fbl Copy item path Source pub use pin_init ;canary impl_instanced_slab_allocatable Macro to implement InstancedSlabAllocated and Recyclable for a struct. impl_opaque_ref_counted_facade Declares a zero-sized facade struct for an opaque refcounted C++ object and implements
HasRefCount and Recyclable for it. impl_opaque_unique_facade Declares a zero-sized facade struct for an opaque ktl::unique_ptr-owned C++ object and
implements Recyclable for it so it can be held by fbl::UniquePtr. impl_static_slab_allocatable Macro to implement StaticSlabAllocated and Recyclable for a struct. make_ref_counted Macro to construct a RefPtr, automatically populating the ref_count field. pin_make_ref_counted Macro to construct a RefPtr with pin-initialization, automatically populating the ref_count
field. try_pin_make_ref_counted Macro to construct a RefPtr with fallible pin-initialization, automatically populating the
ref_count field. try_vec Macro to construct a fallible Vector. Array A fixed-size array that takes ownership of its elements.
This is a Rust analog to fbl::Array in C++. Canary An embeddable structure guard. Cursor A read-only cursor positioned in a WavlTree. CursorMut A cursor over elements in a WavlTree. DefaultHashTraits The default HashTraits implementation for a HashTable. DefaultObjectTag The default tag used when an object participates in only one list. DoublyLinkedList An intrusive doubly linked list container supporting custom ownership semantics, constant-time
operations, and circular-like node layout. DoublyLinkedListNode A node in a doubly linked list. ForwardIterator A unidirectional forward iterator over the elements of a DoublyLinkedList. ForwardIteratorMut A unidirectional forward mutable iterator over the elements of a DoublyLinkedList. HashTable An intrusive, unordered, associative hash table container. HashTableCursorMut A cursor positioned at an element of a HashTable (or at no element), which can be used to
access or erase that element. HashTableIter An iterator over the elements of a HashTable, in an unspecified order. InlineArray Runtime-determined, fixed size arrays that are “inlined” (e.g., on the stack) if the size at
most N or heap-allocated otherwise. Iterator An iterator over the elements of a DoublyLinkedList. IteratorMut A mutable bidirectional iterator over the elements of a DoublyLinkedList. Name A fixed-size, thread-safe name buffer with automatic truncation and null-termination. NonTrackingSize A size tracker that does not actually track the size (zero overhead). OpaqueRefCounted A wrapper for C++ objects that are known to use fbl::RefCounted
and have their reference count at offset 0. OpaqueRefCountedFacade A zero-sized facade type for opaque ref-counted C++ objects that derive from a base class B. PackedPointer A pointer wrapper that allows storing a small amount of data in the alignment bits of the
pointer. RefCounted Support for intrusive atomic reference counting. RefPtr RefPtr<T> holds a reference to an intrusively-refcounted object of type
T that deletes the object when the refcount drops to 0.ReverseIterator A unidirectional reverse iterator over the elements of a DoublyLinkedList. ReverseIteratorMut A unidirectional reverse mutable iterator over the elements of a DoublyLinkedList. RingBuffer RingBuffer is a statically-allocated, typed ring buffer container.
This container is not thread safe.SinglyLinkedList A singly linked list that supports intrusive nodes and different ownership semantics. SinglyLinkedListNode A node in a singly linked list. SlabAllocator A slab-style allocator for a given object type T. SlabOrigin A helper type to store the originating slab allocator for instanced allocations. StringBuffer A fixed-size buffer for assembling a string. TrackingSize A size tracker that maintains the count of elements in the list. UniquePtr UniquePtr<T> holds a unique pointer to an object of type T and deletes the
object when the UniquePtr goes out of scope.Vector Vector is a heap-allocated dynamic array, providing a subset of the
functionality of std::vec::Vec.WavlTree WavlTreeAugmentedInvariantObserver A WAVL tree observer that maintains augmented invariants. WavlTreeNode A node in a Weak AVL (WAVL) Tree. CONTAINER_SENTINEL_BIT DEFAULT_SLAB_ALLOCATOR_SLAB_SIZE The default slab size in bytes (16KB). BitsSource BitsTarget DefaultHashable Key types which can be hashed by DefaultHashTraits. DoublyLinkedListContainable Trait that types must implement to be contained in a DoublyLinkedList. HasRefCount Trait to be implemented by types that contain a RefCounted field. HasRefCountUpgradeable Trait for an object to mark itself as allowing the make_ref_ptr_upgrade_from_raw operation,
which can be used to give weak-pointer like behavior for very specific use cases. HashTableBucket A list type which can be used as the bucket type of a HashTable of pointers of type P. HashTableKeyable Trait that types must implement to expose the key used to store them in a HashTable. HashTraits Traits defining the hash function used by a HashTable to select a bucket for a key. InstancedSlabAllocated Trait implemented by types that can be allocated from an instanced slab allocator. IsOpaqueRefCounted Trait for facade types that wrap an OpaqueRefCountedFacade<B> and derefer to B. IsRawMutex Helper trait to restrict SlabAllocator lock to RawMutex.
TODO(https://fxbug.dev/541903019): Support generic mutex types. ManagedPtr Marker trait for managed pointer types (like UniquePtr and RefPtr). MutPtr Marker trait for pointer types through which intrusive containers may hand out mutable
(pinned) access to their elements (e.g. front_mut(), iter_mut(), CursorMut::get_mut()). PtrTraits Trait for pointer types that can be stored in intrusive containers. RawLock Trait defining a raw, un-instrumented synchronization lock abstraction. Recyclable Trait for types that can be recycled (deallocated). SinglyLinkedListContainable Trait that types must implement to be contained in a SinglyLinkedList. SizeTracker Trait for tracking the size of the list. StaticSlabAllocated Trait implemented by types that can be allocated from a static slab allocator. UninitRecyclable Trait for types that can be allocated in an uninitialized state. WavlTreeAugmentedInvariantObserverTraits Traits to implement to use WavlTreeAugmentedInvariantObserver. WavlTreeContainable Trait that types must implement to be contained in a WavlTree. WavlTreeKeyable Trait that types must implement to expose a key for WavlTree sorting and lookup. WavlTreeObserver Trait defining an observer for a WavlTree. conditional_select_nospec_eq returns a if x == y, b otherwise.
Immune to speculative execution information leak bugs such as Spectre V1. conditional_select_nospec_lt returns a if x < y, b otherwise.
Immune to speculative execution information leak bugs such as Spectre V1. confine_array_index returns index if index < size, or 0 if index >= size.
Immune to speculative execution information leak bugs such as Spectre V1. extract_bit extract_bits Extracts the bit range [HIGH_BIT:LOW_BIT] (inclusive) from a numerical input. is_sentinel_ptr Test to see if a pointer is a sentinel pointer. magic Function for generating canary magic values from strings make_sentinel Create a sentinel pointer from a raw pointer. make_sentinel_null Create a sentinel pointer from null. remove_from_container ⚠ Removes an object from its container without a reference to the container. unmake_sentinel Turn a sentinel pointer back into a normal pointer. valid_sentinel_ptr Test to see if a pointer (which may be a sentinel) is valid.
Valid means it is not null and not a sentinel. HashTableInsertOrFindResult The result of HashTable::insert_or_find. ref_counted Attribute macro to make a struct reference counted. DoublyLinkedListContainable Derive macro to implement DoublyLinkedListContainable for a struct. Recyclable Derive macro to implement Recyclable for a struct using kalloc::Box. SinglyLinkedListContainable Derive macro to implement SinglyLinkedListContainable for a struct. WavlTreeContainable Derive macro to implement WavlTreeContainable for a struct.