Skip to main content

Crate aver_rt

Crate aver_rt 

Source
Expand description

§aver-rt

aver-rt is the shared Rust runtime for Aver.

It is used by:

  • the Aver VM runtime adapters in this repository
  • Rust projects generated by aver compile

The crate exists so Aver semantics live in one place instead of being duplicated between the VM runtime and generated Rust output.

That shared-runtime role is practical, not just architectural. Improvements to AverList, String.slice, or service helpers here affect both generated Rust programs and the VM-facing adapters that rely on the same semantics.

§What it contains

  • AverList<T>: persistent list used by Aver list operations, including deep-list paths such as teardown, tail, and list_uncons; append-heavy chains are packed into structural segments so the VM and generated Rust share the same faster behavior on append + get(i) workloads
  • AverDisplay: Aver-specific display formatting used by Console.print and string interpolation
  • shared runtime helpers for console, time, disk, env, and string operations
  • shared service types:
    • Header
    • HttpResponse
    • HttpRequest
    • TcpConnection
  • shared service runtimes:
    • tcp
    • http (behind the http feature)
    • http_server

§Features

  • default: no optional dependencies
  • http: enables the HTTP client runtime via ureq

§Stability

This crate is primarily intended to support Aver-generated programs and the Aver VM runtime. The public API should be treated as young and evolving.

§Repository

Re-exports§

pub use terminal::TerminalGuard;
pub use terminal::clear as terminal_clear;
pub use terminal::disable_raw_mode as terminal_disable_raw_mode;
pub use terminal::enable_raw_mode as terminal_enable_raw_mode;
pub use terminal::flush as terminal_flush;
pub use terminal::hide_cursor as terminal_hide_cursor;
pub use terminal::move_to as terminal_move_to;
pub use terminal::print_at_cursor as terminal_print;
pub use terminal::read_key as terminal_read_key;
pub use terminal::reset_color as terminal_reset_color;
pub use terminal::restore_terminal;
pub use terminal::set_color as terminal_set_color;
pub use terminal::show_cursor as terminal_show_cursor;
pub use terminal::size as terminal_size;

Modules§

http
http_server
random
tcp
terminal

Macros§

aver_list_match
Pattern-match on an AverList: empty and cons (head, tail) arms.

Structs§

AverList
AverListIter
AverMap
AverStr
Aver string type: newtype over Rc for O(1) clone and native + operator.
AverVector
HttpRequest
HttpResponse
TcpConnection
TerminalSize

Traits§

AverDisplay

Functions§

append_text
aver_display
aver_str_concat
Concatenate two AverStr values.
cli_args
console_error
console_print
console_warn
delete_dir
delete_file
env_get
env_set
list_dir
list_uncons
list_uncons_cloned
make_dir
par_execute
Execute tasks in parallel using scoped threads. All branches run to completion (complete mode).
par_execute_sequential
Execute tasks sequentially, left-to-right. Used by sequential mode. Valid per the language spec (the fully-sequential interleave is always permitted). Available on every target — no threading required.
par_execute_with_cancel
path_exists
read_line
read_text
string_join
string_slice
time_now
time_sleep
time_unix_ms
write_text

Type Aliases§

Buffer
Internal builder for the deforestation lowering (0.15 Traversal). Backs __buf_* intrinsics emitted when the compiler fuses String.join(<builder>(...), sep) shapes — String::with_capacity plus push_str is exactly the right shape, no GC dance needed. User code never sees this directly; it lives strictly between __buf_new and __buf_finalize inside synthesized helpers.
CancelTask
Execute tasks in parallel with cooperative cancellation (cancel mode).
HttpHeaders
Multi-value HTTP headers, modelled as Map<String, List<String>> — matches RFC 9110 (same-name fields) and RFC 6265 (multiple Set-Cookie). Keys are case-insensitive by convention; runtime lowercases incoming names. Mirrors Go net/http.Header.