Skip to main content

Crate ruc

Crate ruc 

Source
Expand description

GitHub top language Rust Latest Version Rust Documentation Minimum rustc version

§ruc

Rust Util Collection, components included:

  • Chained error management
  • Local command execution based on rust standard library
    • required features: cmd
  • Remote command execution based on the SSH protocol
    • required features: ssh
  • Interprocess Communication Based on Unix Abstract Sockets
    • required features: uau
    • only available on various Linux platforms
    • the built-in functions only support the UDP protocol
  • Algorithm operations
    • required features: algo
      • rand, hash, ecc sigature, etc.
  • Encode/Decode operations
    • required features: ende
      • hex, base64
      • zlib compress, zlib uncompress
      • json, message-pack, serde transcode
      • and so on …

In addition, there is a feature named “full”, using it will enable all functional features.

§Documentations

# cargo doc --all-features --open
make doc

Links to static documentations:

§ENV VARs
  • $RUC_SSH_TIMEOUT: ssh process timeout, in seconds
    • Default to 20s
    • The max value is 300s(5 minutes)
  • $RUC_HTTP_TIMEOUT: http process timeout, in seconds
    • Default to 3s
    • The max value is 255s(u8::MAX)
    • Unparsable or out-of-range values fall back to the default(3s)
    • Read once at the first request, later changes have no effect

§Gratitude

Thanks to all the people who already contributed!

Re-exports§

pub use err::*;

Modules§

algo
cmd
cmd
common
Common
ende
err
Error management
http
ssh
SSH
uau
UAU

Macros§

bmap
BTreeMap literal, e.g. bmap!{1 => 2}.
bset
BTreeSet literal, e.g. bset!{1, 2}.
d
Generate debug info, e.g., file path, line number, column number
datetime
get current DateTime
die
Just a panic
eg
Generate error with debug info
ensure
Ensure a condition is true, otherwise return an error.
eprint_msg
eprint custom msg
info
Print information only
info_omit
Drop the result after printing the message
map
HashMap literal, e.g. map!{1 => 2}.
max
find the max value of multi values
min
find the min value of multi values
omit
omit the result without printing any message
pnk
Print log, and panic
print_msg
print custom msg
set
HashSet literal, e.g. set!{1, 2}.
sleep_ms
Sleep in milliseconds
ts
get current UTC-timestamp in seconds
ts_ms
get current UTC-timestamp in milliseconds