Skip to main content

Module value

Module value 

Source
Expand description

Values as compiled code holds them: every value fits in a 64-bit Slot.

An int is its two’s-complement bits, a float its IEEE bits, a bool 0 or 1, and a string, list or struct a pointer to a reference-counted object. Zero in a slot of one of those types means “no value yet”, and retaining or releasing it does nothing. Lists and structs share their contents until a copy is changed, so values keep value semantics.

Re-exports§

pub use crate::symbols::BOOL;
pub use crate::symbols::FLOAT;
pub use crate::symbols::INT;
pub use crate::symbols::STRING;

Structs§

ListObject 🔒
StringObject 🔒
StructObject 🔒
TypeDesc
A type, as a compiled program describes it. Struct types may lead back to themselves through their fields, so these form a graph of statics.
Value 🔒
A value the runtime owns, released when dropped.

Enums§

TypeKind
What kind of value a TypeDesc describes; compiled programs store it as a u8.

Statics§

LIST_OF_STRINGS 🔒
[string], the type of the paths a file dialog answers with and of what is dropped.

Functions§

as_list 🔒
as_str 🔒
The text of a string slot that someone owns for 'a.
as_struct 🔒
borrow 🔒 ⚠
The object a slot holds, borrowed for as long as the slot keeps it alive.
equal 🔒
Whether two values of type ty are equal, as == decides.
from_slot 🔒 ⚠
Takes the object a slot owns.
int 🔒
int_slot 🔒
into_slot 🔒
The slot holding an object, which the slot now owns.
list_mut 🔒
Makes the list in place its only owner’s, copying it if shared, and returns it.
list_slot 🔒
A list of type ty holding items, which it takes ownership of.
pointer 🔒
release 🔒
Removes an owner from the value in slot, freeing it with its last owner.
retain 🔒
Adds an owner to the value in slot.
string_slot 🔒
strings_slot 🔒
A [string] holding texts, in order.
struct_mut 🔒
unique 🔒
write 🔒
Writes a value of type ty as it reads inside an interpolated string.
write_items 🔒

Type Aliases§

Slot