Expand description
§The Rune core allocation and collections library
This library provides smart pointers and collections for managing heap-allocated values.
It is a fork of the alloc and hashbrown crates with the following
additions:
- All allocations are fallible, and subject to memory limits imposed by the
limitmodule. - All colllections can be used by dynamic types, which can fallibly
implement the trait they need. Such as
HashandEqforHashMaporOrdforBTreeMap. This is accomplished using alternative functions which receive fallible closures and contexts, such asBTreeMap::get_mut_with.
§Boxed values
The Box type is a smart pointer type. There can only be one owner of a
Box, and the owner can decide to mutate the contents, which live on the
heap.
This type can be sent among threads efficiently as the size of a Box value
is the same as that of a pointer. Tree-like data structures are often built
with boxes because each node often has only one owner, the parent.
§Collections
Implementations of the most common general purpose data structures are defined in this library. They are re-exported through the standard collections library.
§Heap interfaces
The alloc module defines the low-level interface to the default global
allocator. It is not compatible with the libc allocator API.
Modules§
- alloc
- Allocated types.
- borrow
- A module for working with borrowed data.
- boxed
- The
Box<T>type for heap allocation. - btree_
map - An ordered map based on a B-Tree.
- btree_
set - An ordered set based on a B-Tree.
- clone
- The
TryClonetrait for types that cannot be ‘implicitly copied’. - error
- Error types used by rune alloc.
- fmt
- Built-in formatting utilities.
- hash_
map - hash_
set - iter
- Composable external iteration.
- limit
- Memory limits for Rune.
- path
- Cross-platform path manipulation.
- prelude
- Prelude for common traits used in combination with this crate which matches the behavior of the std prelude.
- str
- Utilities for the
strprimitive type. - string
- A UTF-8–encoded, growable string.
- sync
- vec
- A contiguous growable array type with heap-allocated contents, written
Vec<T>. - vec_
deque - A double-ended queue (deque) implemented with a growable ring buffer.
Macros§
- try_
format - Creates a
Stringusing interpolation of runtime expressions. - try_vec
Structs§
- BTree
Map - An ordered map based on a B-Tree.
- BTree
Set - An ordered set based on a B-Tree.
- Box
- A pointer type that uniquely owns a heap allocation of type
T. - HashMap
- A hash map implemented with quadratic probing and SIMD lookup.
- HashSet
- A hash set implemented as a
HashMapwhere the value is(). - String
- A UTF-8–encoded, growable string.
- Vec
- A contiguous growable array type, written as
Vec<T>, short for ‘vector’. - VecDeque
- A double-ended queue implemented with a growable ring buffer.
Enums§
- Error
- The error type for methods which allocate or reserve.
Functions§
- abort
- Terminates the process in an abnormal fashion.