abla/builtins/declarations
Generated from source.
Source module; follow its importing module's re-export links.
Source: abla/builtins/declarations.ab
bool (class)
class bool
true or false.
i8 (class)
class i8
A signed 8-bit integer. Arithmetic wraps; convert explicitly to mix widths: i8(value).
i16 (class)
class i16
A signed 16-bit integer. Arithmetic wraps; convert explicitly to mix widths: i16(value).
i32 (class)
class i32
A signed 32-bit integer. Arithmetic wraps; convert explicitly to mix widths: i32(value).
i64 (class)
class i64
A signed 64-bit integer. int is i64.
int (class)
class int
A signed 64-bit integer (i64), the type of integer literals and of sizes and indexes.
Fn (class)
class Fn
A function type written with a capture contract: Fn(A) -> R reads what it captures, and can be called many times.
FnMut (class)
class FnMut
A function type written FnMut(A) -> R: a lambda that changes a capture. Affine.
FnOnce (class)
class FnOnce
A function type written FnOnce(A) -> R: a move { ... } lambda, which can be called once. Affine.
FnNoEscape (class)
class FnNoEscape
A function type written FnNoEscape(A) -> R: a callback that the callee may call but not keep.
u8 (class)
class u8
An unsigned 8-bit integer. Arithmetic wraps; convert explicitly to mix widths: u8(value).
u16 (class)
class u16
An unsigned 16-bit integer. Arithmetic wraps; convert explicitly to mix widths: u16(value).
u32 (class)
class u32
An unsigned 32-bit integer. Arithmetic wraps; convert explicitly to mix widths: u32(value).
u64 (class)
class u64
An unsigned 64-bit integer. Arithmetic wraps; convert explicitly to mix widths: u64(value).
f32 (class)
class f32
A 32-bit IEEE floating point number. A literal is an f64 unless its context wants an f32.
f64 (class)
class f64
A 64-bit IEEE floating point number, the type of float literals.
char (class)
class char
A byte-sized character code.
void (class)
class void
No value: the type of an empty block and of a function that returns nothing.
never (class)
class never
No value ever: the type of a call that does not return (panic(...)).
any (class)
class any
Any value. Used by low-level code; ordinary code names a type.
string (class)
class string(
/** The number of bytes. */
val size: int
)
Immutable UTF-8 text, indexed by byte. Reading or slicing outside the string panics.
string.slice (method)
fun slice(begin: int, end: int): string
The bytes from begin up to end as a new string. Panics when the range is outside the string.
array (class)
class array<T>(
/** The number of elements. */
val size: int
)
A growable sequence. [] needs an expected type, or names it: array<int>(). Reading or writing outside the array panics.
array.append (method)
fun append(value: T): void
Adds value at the end.
array.takeAt (method)
fun takeAt(index: int): T
Removes and returns the element at index, moving the later elements down. The result is owned, as a resource's.
array.truncate (method)
fun truncate(size: int): void
Keeps the first size elements (all of them when size is at least the array's size) and keeps the capacity.
array.clear (method)
fun clear(): void
Removes every element and keeps the capacity.
Map (class)
class Map<K, V>(
/** The number of entries. */
val size: int
)
A hash map with string or int keys, in insertion order. Its type must be declared where it is created, or named by the constructor: Map<string, int>().
Map.get (method)
fun get(key: K): V?
The value at key, or null when there is none. The value is lent, not moved.
Map.has (method)
fun has(key: K): bool
Whether key is in the map.
Map.set (method)
fun set(key: K, value: V): void
Stores value at key, replacing what was there.
Map.remove (method)
fun remove(key: K): bool
Removes key. Returns whether it was present.
Map.keys (method)
fun keys(): array<K>
The keys, in insertion order.
Map.values (method)
fun values(): array<V>
The values, in insertion order.
Map.clear (method)
fun clear(): void
Removes every entry.
Map.take (method)
fun take(key: K): V?
Removes key and returns its value, moved out, or null when there is none.
Cell (class)
class Cell<T>
A mutable scalar inside an otherwise read-only object. Single thread; copy scalars only.
Cell.get (method)
fun get(): T
The current value.
Cell.set (method)
fun set(value: T): void
Replaces the value.
Mutex (class)
class Mutex<T>
Exclusive access to an affine value, under a lock. Thread-safe.
Mutex.clone (method)
fun clone(): Mutex<T>
Another handle to the same lock and value.
Mutex.with (method)
fun <R> with(body: (T) -> R): R
Runs body with the value, holding the lock for the whole callback, and returns what it returns.
Shared (class)
class Shared<T>
A reference-counted handle to a value, shared across threads.
Shared.clone (method)
fun clone(): Shared<T>
Another strong handle to the same value.
Shared.get (method)
fun get(): T
The value.
Shared.downgrade (method)
fun downgrade(): Weak<T>
A Weak<T> handle that does not keep the value alive.
Weak (class)
class Weak<T>
A handle to a Shared<T> value that does not keep it alive.
Weak.clone (method)
fun clone(): Weak<T>
Another weak handle to the same value.
Weak.upgrade (method)
fun upgrade(): Shared<T>?
A new strong handle, or null when the value is gone.
Weak.isAlive (method)
fun isAlive(): bool
Whether the value is still alive; observes, without pinning it.
Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.