Library guide · API index and notation
This page is generated from the bundled library in this checkout. Signatures and adjacent source comments are reproduced below; the linked guide explains usage, storage, failures, and platform support.
import "std/window/heap"
Names used in signatures
Unqualified names denote this package’s types (including other source files in the same package), language built-ins, or generic parameters such as T. Qualified names use the import aliases below. These aliases belong to the library source; import a dependency yourself to use its alias in your program.
| Alias | Package | Source file |
|---|---|---|
mem |
core/mem |
heap.dodo |
ptr |
core/ptr |
heap.dodo |
Bytes
Struct · Source
Zeroed bytes owned by this value and freed with it. An empty block has a valid address too, as a Dodo slice needs one.
pub struct Bytes {
// Public only so a static can start empty: all zero. Use the methods.
pub address: usize
pub length: usize
}
Bytes.new
Function · Source
lengthzero bytes; none when the memory is not available.
pub fn new(length: usize) -> Option<Bytes>
Bytes.empty
Function · Source
pub fn empty() -> Bytes
Bytes.len
Function · Source
pub fn len(&self) -> usize
Bytes.pointer
Function · Source
pub fn pointer(&self) -> *mut u8
Bytes.bytes
Function · Source
pub fn bytes(&mut self) -> &mut[u8] from(self)
Bytes.view
Function · Source
pub fn view(&self) -> &[u8] from(self)
Table
Struct · Source
A growable array of plain records, such as one per open window. The order is not kept: remove() moves the last record into the hole.
pub struct Table<T> {
// Public only so a static can start empty: all zero. Use the methods.
pub address: usize
pub count: usize
pub capacity: usize
}
Table.new
Function · Source
pub fn new() -> Table<T>
Table.len
Function · Source
pub fn len(&self) -> usize
Table.records
Function · Source
pub fn records(&mut self) -> &mut[T] from(self) requires_plain(T)
Table.view
Function · Source
pub fn view(&self) -> &[T] from(self) requires_plain(T)
Table.push
Function · Source
Append a record; false when memory runs out.
pub fn push(&mut self, record: T) -> bool requires_plain(T)
Table.remove
Function · Source
Remove the record at
index, replacing it with the last one.
pub fn remove(&mut self, index: usize) requires_plain(T)
Table.truncate
Function · Source
Keep only the first
countrecords, and the memory for later pushes.
pub fn truncate(&mut self, count: usize)
Table.clear
Function · Source
Remove every record and free the memory.
pub fn clear(&mut self)