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/text_shared"
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 |
|---|---|---|
bytes |
core/bytes |
text_shared.dodo |
error |
alloc/error |
text_shared.dodo |
hash |
std/hash |
text_shared.dodo |
layout |
alloc/layout |
text_shared.dodo |
mem |
core/mem |
text_shared.dodo |
shared_arena |
alloc/shared_arena |
text_shared.dodo |
shared_vector |
std/collections/shared_vector |
text_shared.dodo |
text |
std/text |
text_shared.dodo |
vector |
std/collections/vector |
text_shared.dodo |
Error
Enum · Source
Owned UTF-8 with a shared allocator capability and an explicit byte limit. The private vector can only be mutated through UTF-8-preserving operations.
pub enum Error {
Text(text.Error), Allocation(error.AllocError)
}
String
Struct · Source
pub struct String {
// Private implementation fields omitted.
}
String.len_bytes
Function · Source
pub fn len_bytes(&self) -> usize
String.capacity
Function · Source
pub fn capacity(&self) -> usize
String.limit
Function · Source
pub fn limit(&self) -> usize
String.as_str
Function · Source
pub fn as_str(&self) -> &str
String.as_text
Function · Source
pub fn as_text(&self) -> text.Text
String.reserve
Function · Source
pub fn reserve(&mut self, additional: usize) -> void!error.AllocError
String.append_str
Function · Source
pub fn append_str(&mut self, value: &str) -> void!error.AllocError
String.append
Function · Source
pub fn append(&mut self, value: &text.Text) -> void!error.AllocError
String.truncate
Function · Source
pub fn truncate(&mut self, length: usize) -> void!text.Error
String.push
Function · Source
pub fn push(&mut self, scalar: u32) -> void!Error
String.clear
Function · Source
pub fn clear(&mut self)
new
Function · Source
Empty construction allocates no bytes. The limit bounds logical UTF-8 bytes; vector growth may reserve extra capacity. No implicit process heap is used.
pub fn new(allocator: shared_arena.Handle, limit: usize) -> String!error.AllocError from(allocator)
from_str
Function · Source
pub fn from_str(allocator: shared_arena.Handle, value: &str, limit: usize) -> String!error.AllocError from(allocator)
from_text
Function · Source
pub fn from_text(allocator: shared_arena.Handle, value: &text.Text, limit: usize) -> String!error.AllocError from(allocator)
Key
Struct · Source
Lexicographic UTF-8 byte ordering and deterministic FNV-1a hashing.
pub struct Key {
}
Key.compare
Function · Source
pub fn compare(&self, a: &String, b: &String) -> i32
Key.equal
Function · Source
pub fn equal(&self, a: &String, b: &String) -> bool
Key.hash
Function · Source
pub fn hash(&self, value: &String) -> u64