Summary
A toolbox library that holds a useful collection of small unitilies written in Rust that make our life easier when writting Rust applications.
Utilities provided:
Mathematics
A collection of useful methematic methods used in various DSP and other applications
Archives
Extract files from Tar, Gz and Zip Files
Mininal Example:
let archive: PathBuf = current_exe
.unwrap
.parent
.unwrap
.join;
let file: PathBuf = "treasure.hex".into;
let destination: PathBuf = current_exe
.unwrap
.parent
.unwrap;
extract_file.unwrap;
Bits
Convertions between different representations of raw bit streams
Mininal Example:
let received_bit_stream: u64 = 0b110101000100111010110;
let bytes = bits_to_vec;
println!;
Config
Manipulate INI-style configuration files by checking for changes, updates etc
Mininal Example:
let mut config_changes = ini_compare
.unwrap;
println!;
Logger
Initialize terminal and file loggers fast. Macros for log printing to either log or stdout (if a global logger is not initialized)
Mininal Example:
log_info!;
log_debug!;
terminal_logger_init;
log_info!;
log_debug!;
Paths
Search paths for a specific file in directories with known or unknown paths
Mininal Example:
let paths = new
.include_exe_dir
.include_known
.include_unknown
.build;
let pattern = "test_*.tar";
let file_found_in = paths.search_glob;
Stopwatch and Timekeper
Keep track of execution times in various points in binaries. Print records.
Minimal Example:
let mut s = init;
let mut t = init;
s.totals;
s.lap;
for _ in 0..5
s.lap_totals;
sleep;
s.lap;
s.totals;
t.totals;
s.merge;
s.totals;
Versions
version parser from strings using the semver.org
notations
Mininal Example:
let version = "0.9.2-1e341234";
let mut expected = new;
expected.pre = new.unwrap;
assert_eq!;
SSH Client
Connect via SSH to a server to perform commands, upload & download files
Mininal Example:
let ssh = local.unwrap;
let stdout = ssh.execute_cmd.unwrap;
println!;
TCP Client
Connect via TCP to a socket to send and receive data
Mininal Example:
let mut tcp_client = new?;
let data: = vec!;
tcp_client.send?;
// Block and wait for response
let resp = tcp_client.receive?;
println!;
TCP Client
Connect via UDP to a socket to send and receive data
Mininal Example:
let mut udp =
new.unwrap;
udp.send.unwrap;
// Block and wait for response
let data = udp.receive.unwrap;
println!;
ZMQ Client
Connect to a ZMQ server to send and receive data
Mininal Example:
let zmq_client = new