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 interpreter/runtime adapters in this repository
  • Rust projects generated by aver compile -t rust

The crate exists so Aver semantics live in one place instead of being duplicated between the interpreter 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 interpreter-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 interpreter 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 interpreter. 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

Structs§

AverList
AverListIter
Header
HttpRequest
HttpResponse
TcpConnection
TerminalSize

Traits§

AverDisplay

Functions§

append_text
aver_display
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
path_exists
read_line
read_text
string_join
string_slice
time_now
time_sleep
time_unix_ms
write_text