pistonite-cu 0.3.1

Battery-included common utils to speed up development of rust tools
Documentation

Batteries-included common utils

Install

Since crates.io does not have namespaces, this crate has a prefix. You should manually rename it to cu, as that's what the proc-macros expect.

# Cargo.toml
# ...
[dependencies.cu]
package = "pistonite-cu"
version = "..." # check by running `cargo info pistonite-cu`
features = [ "full" ] # see docs

# ...
[dependencies]

General Principal

cu tries to be as short as possible with imports. Common and misc utilities are exported directly by the crate and should be used as cu::xxx directly. Sub-functionalities are bundled when makes sense, and should be called from submodules directly, like cu::fs::xxx or cu::co::xxx. The submodules are usually 2-4 characters.

The only time to use use to import from cu, is with the prelude module pre:

# use pistonite_cu as cu;
use cu::pre::*;

This imports traits like [Context] and [PathExtension] into scope.

Feature Reference:

  • cli, print, prompt: See cli. Note that logging is still available without any feature flag.
  • coroutine and coroutine-heavy: Enables async and integration with tokio. See cu::co.
  • fs: Enables file system utils. See cu::fs and cu::bin.
  • process: Enables utils spawning child process. See [Command].
  • parse, json, yaml, toml: Enable parsing utilities, and additional support for common formats. See Parse.