Skip to main content

Module memory

Module memory 

Source
Expand description

Shared byte allowances with reservations that follow allocation ownership.

Owners reserve requested buffer layouts before allocating and charge any additional reported capacity before moving values. Allocator bookkeeping, borrowed data, and separately owned immutable resources are outside this allowance.

Structs§

Budgeted
An immutable result and its owned allocations. Cloning the value is a separate allocation.
BudgetedBinaryHeap
BudgetedDeque
BudgetedHashSet
A linear-probing set with reserved bucket layouts, including hashes, occupancy and alignment. Element-owned allocations remain the caller’s responsibility. Growth retains both bucket buffers until every entry has moved; it never rehashes user values while publishing the replacement.
BudgetedMap
An ordered map with logarithmic lookup, insertion and removal. Each node reserves its entire allocation before construction; keys and values retain their own separately allocated payloads. Removing a node frees its allocation before releasing that reservation. The map never clones elements or retains unused nodes.
BudgetedMapIter
BudgetedSharedMap
A persistent ordered map with logarithmic lookup and insertion. Cloning shares a root without copying entries or allocating. Updates reserve the complete insertion before mutation, reuse unique nodes and copy shared paths; unchanged entries and subtrees keep their original reservations until their last root is dropped. Keys and values retain their separately owned payloads.
BudgetedSharedMapIter
BudgetedString
BudgetedVec
MemoryBudget
Clones share one allowance, including reservations retained by completed producers.
MemoryReservation
A unique lease: release it only after the associated allocation has been freed.
OwnedMap
An ordinary mutable ordered map with exact node ownership. Unlike BudgetedMap, insertion has no allowance and cannot be used as an admitted producer by itself. An enclosing controlled producer must reserve entry_bytes() before allocating each new entry and retain that lease until the map is dropped. Separately allocated key/value payloads require their own reservations.
OwnedMapIntoIter
Consuming traversal keeps the pending AVL path on the stack and frees each visited node before yielding its entry.
OwnedSet
An ordinary ordered set with exact node layouts and the same enclosing-owner admission contract as OwnedMap.
OwnedSetIntoIter
OwnedSetIter
PreparedMapEntry
An unpublished node and its reservation. Preparing several entries allows an owner to finish every fallible reservation before publishing any map mutation.
Produced
A produced value with its existing controlled lease, or an explicit ordinary result. There is no mutable dereference or generic map operation that could replace it with newly allocated, unadmitted payloads.
ProductionControl
Allocation and cancellation inputs borrowed for one production call. An ordinary call has no allowance or cancellation scope; a controlled call preserves both the original retained owner and the invoking reader.
ProductionString
A string constructor that admits replacements through the existing budgeted buffer and checks both cancellation owners between bounded UTF-8 chunks.
ProductionVec
Admitted vector capacity and element payloads have separate leases until the completed result combines them. Copy-only scratch elements need no payload owner; owned elements enter through push_produced.

Enums§

MemoryError