Re-exports

pub use color_text::styles::*;
pub use color_text::styles::*;
pub use color_text::*;
pub use decl_macros::*;

Modules

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.

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.

Similar to with! except $id is a mutable reference to the $eval expression.