Crate r3bl_rs_utils_core
source · [−]Re-exports
pub use color_text::styles::*;
pub use async_safe_share_mutate::*;
pub use color_text::styles::*;
pub use color_text::*;
pub use decl_macros::*;
Modules
ANSI colorized text https://github.com/ogham/rust-ansi-term helper methods.
Macros
Syntactic sugar to run a conditional statement. Here’s an example.
This is a really simple macro to make it effortless to use the color console logger. It takes a single identifier as an argument, or any number of them. It simply dumps an arrow symbol, followed by the identifier (stringify’d) along with the value that it contains (using the Debug formatter). All of the output is colorized for easy readability. You can use it like this.
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:
Wrap the given block or stmt so that it returns a Result<()>. It is just syntactic sugar that helps having to write Ok(()) repeatedly.
Wrap the given block or stmt so that it returns a Result<$it>. It is just syntactic sugar that helps having to write Ok($it) repeatedly.
Unwrap the $option
, and if None
then run the $next
closure which must return a
value that is set to $option
. Basically a way to compute something lazily when it
(the Option
) is set to None
.
Unwrap the $option
, and if None
then run the $next
closure which must return an
error. This macro must be called in a block that returns a ResultCommon<T>
.
Runs the $code
block after evaluating the $eval
expression and assigning it to
$id
.