Skip to main content

Crate intuicio_data

Crate intuicio_data 

Source
Expand description

Type-erased data primitives that the rest of Intuicio is built on.

Intuicio moves values around without knowing their Rust types at compile time, so every value is handled as raw bytes plus a type_hash::TypeHash and a drop function. This crate provides the containers that do that:

  • data_stack - the stack and register storage used to pass values between function calls.
  • lifetime - runtime borrow checking for values that outlive Rust’s static lifetimes.
  • managed - reference counted and garbage collected value boxes.
  • shared - thin Rc<RefCell> / Arc<RwLock> wrappers.
  • type_hash - cheap runtime type identity.

§Features

  • alloc-backtrace - print a backtrace on every allocation made through the non_zero_* helpers.
  • typehash_debug_name - keep the type name inside type_hash::TypeHash for readable diagnostics.

Modules§

data_stack
Type-erased stack that carries values between function calls.
lifetime
Runtime borrow checking for values Rust cannot track statically.
managed
Value boxes with runtime checked borrowing.
shared
Shared ownership wrappers with fallible, non-panicking access.
type_hash
Cheap runtime type identity.

Enums§

Finalizer
How an owning box drops the value it holds.

Traits§

Destructor
Drops a value whose type has no Rust counterpart.
Finalize
Drops a value through a raw pointer.
Initialize
Writes a default value through a raw pointer.

Functions§

non_zero_alloc
std::alloc::alloc that accepts zero-sized layouts.
non_zero_alloc_zeroed
std::alloc::alloc_zeroed that accepts zero-sized layouts.
non_zero_dealloc
std::alloc::dealloc counterpart of non_zero_alloc.
non_zero_realloc
std::alloc::realloc counterpart of non_zero_alloc.
pointer_alignment_padding
Returns how many bytes must be skipped after pointer to reach an address aligned to alignment.