Crate r3bl_rs_utils
source · [−]Expand description
This crate provides utility functions to do the following:
- Non binary tree data structure that is safe to use across threads and supports parallel tree walking & processing (inspired by memory arena.
- Kotlin inspired scope functions that make
it easy to work w/ wrapped values (wrapped in
std::sync::Arc
<std::sync::RwLock
>, orOption
, etc). - Print colored text to the terminal. And create TUI (text user interface) applications, similar to what you can do w/ Ink, React, and TypeScript on Node.js.
Modules
ANSI colorized text https://github.com/ogham/rust-ansi-term helper methods.
This is an experimental module that isn’t ready yet. It is the first step towards creating a TUI library that can be used to create sophisticated TUI applications. This is similar to Ink library for Node.js & TypeScript (that uses React and Yoga)
This module contains a lot of utility functions that are meant to:
Macros
Declarative macro to surround the given block with a call to tokio::spawn
. This is
useful for spawning a task that will run in the background from a function that is NOT
async.
Declarative macro to generate the API call functions. This adds the following:
Macros to unwrap various locks.
Traits
This trait marks a type as being safe to mutate (interior mutability) across threads
(parallel safe) and tasks (async safe). These are just convenience static methods. You
can simply use the read()
and write()
methods directly on the Arc
reference.
This trait marks a type as being safe to share across threads (parallel safe) and tasks (async safe).
Functions
Equivalent for template string literal. One way to do this using format!