Crate rusty_dumb_tools

Source
Expand description

A collection of simple tools in Rust as Rust modules:

For a demo program of using the tools, you may want to run the included demo function demo::run_demo like

use rusty_dumb_tools::demo;
// demo::run_demo(None);  // get arguments from command-line         
demo::run_demo(Some(vec!["calc", "-h"]));  // pass in explicit arguments        

Assuming new Rust project with main.rs like

use rusty_dumb_tools::demo;
fn main() {
   demo::run_demo(None);
}

the demo can be cargo run like

  • cargo run -- -h
  • cargo run -- calc -h
  • cargo run -- calc 1.1 + 2.2 * (4.3 - 2.4) + 5
  • cargo run -- calc-repl
  • cargo run -- ltemp Trevor
  • cargo run -- lblscreen
  • cargo run -- arg -f 0.2 5 --string2 VAL1 false 1 2 3

You may also want to visit the source in rusty_dumb_tools GitHub repo

Enjoy!

Greeting from the author Trevor Lee:

Peace be with you! May God bless you! Jesus loves you! Amazing Grace!

Modules§

arg
A simple argument parser – crate::arg::DumbArgParser
calc
A simple infix calculation processor – crate::calc::DumbCalcProcessor
calculator
A simple calculator that accepts input keys acting like a real calculator. It is base on crate::calc::DumbCalcProcessor for it’s calculation processing.
demo
Home for rusty_dumb_tools demo, and sub-demos for the various tools included in this crate. Please refer to crate::demo::run_demo.
json
A simple JSON processor / stream parser – crate::json::DumbJsonProcessor
lblscreen
A simple terminal / text-based “screen” update helper – crate::lblscreen::DumbLineByLineScreen
ltemp
A simple line template for formatting a line, which can be use for printing values as a line with some template – crate::ltemp::DumbLineTemplate
prelude
All the common ‘uses’ of this crate – use rusty_dumb_tools::prelude::*;
progress
A simple Iterator wrapper that helps to show progress of iteration – crate::progress::DumbProgressIndicator
shared
Things shared by the different tools of this crate.

Macros§

dap_arg
use this macro to create a DumbArgBuilder instance to build argument object (argument specification) to be added to DumbArgParser with DumbArgBuilder::add_to the macro accepts one for more strings (positional argument name or flags) like
dlt_comps
use this macro to compose DumbLineTemplate components
dltc
use this macro to construct a value-mapped DumbLineTemplate component (a MappedLineTempCompBuilder to be precise), and it is expected to be use together with dlt_comps!
dpi_into_iter
use this macro to wrap a Vec into_iter() with DumbProgressIndicator to show progress of iteration
dpi_iter
use this macro to wrap a Vec iter() with DumbProgressIndicator to show progress of iteration
dpir
use this macro to wrap a Range with DumbProgressIndicator to show progress of iteration
dpiw
use this macro to wrap an Iterator with DumbProgressIndicator to show progress of iteration
sap_arg
please consider using the macro crate::dap_arg! instead, since this macro will be deprecated