Expand description
§wiwi
A (not so) lil lib containing misc utilities, and Stuff™. Contains some useful things, contains some silly things. Contains many things!
Everything wiwi can do is gated behind feature flags, none of which are enabled by default.
§Features
After these descriptions of the different types of features, there will be a subsection dedicated to listing each feature.
Stable features are what you might expect, they are considered done and follow semver. Of course this does not mean there can’t be functionality added, or that it can’t break (if it does, there will be breaking semver bump, adhering to semver).
Unstable features are features that can be any degree of finished, can break whenever, or disappear whenever. They do not adhere to semver. Before becoming stable, unstable features have -unstable
appended to their name, which will be removed when the feature stabilises. If you are using unstable features, you may find it wise to pin the version to an exact version (ie. semver =
operator, ex. wiwi = "=1.0.0"
in Cargo.toml
).
Addon features enable additional things in some features, including integrations between wiwi
and 3rd-party crates. They will enable things in features where applicable, and will silently do nothing if there’s nothing to affect.
There exist features all
to enable all stable features, all-unstable
to enable all unstable (in addition to stable) features, and all-addons
to enable all addon features (but you very likely do not want this! Unless you’re truly using all the integrations, this can and will bloat your dependency tree).
§Stable features
augment-panic-hook
- Conveniently augment the panic hook (instead of replacing it), running some of your code before calling the existing oneclock-timer
- An interval tracking clock, yielding ticks at specified intervals and doing so for a specified period of timedebounce
- Delay calling a function until a specified period of time has passed since the last time it was calledexport-all-submodules
- A convenience macro for declaring many private modules, then reexporting everything within them using a glob use statementh
- hhex
- Fast hex encoder and decoder for both upper hex and lower hexlazy-wrap
- Wrappers around a lazily initialised value, and its initialisation function, supporting usage in static variablesnominal
- Generic newtype wrappers, for increased type safety through Rust’s nominal type systemrand
- More random number generators and utilitieswith-cloned
- Convenience macro for the clone-and-move pattern (yes, we’re calling it that :p)z85
- Fast encoder and decoder for ZeroMQ’s zZ85 format
§Addon features
hashbrown
- Adds integration withhashbrown
crate (where applicable)image
- Adds integration withimage
crate (where applicable)large-tuples
- By default, implementations on tuples are available for tuples with up to 8 elements, which should be enough for most uses. Enabling this feature will enable implementations for tuples with up to 32 elementsnightly
- Enable features only available in nightly Rustomega-tuples-of-doom
- Surely, no one uses tuples with more than 32 elements in them… but we don’t know everyone’s use case, so this feature will enable implementations for tuples with up to 128 elements. Hopefully, that is enough for everything. :pserde
- Adds integration withserde
crate (where applicable)serde-json
- Adds integration withserde-json
crate (where applicable)
§Unstable features
reminder: Unstable features are NOT covered by semver!
aoc
- Utilities specific for writing solutions for Advent of Codeauth
- Lower-level(ish) utilities for writing an authentication system, in which the client password is never sent over the wirebitstream
- Encoder and decoder for a stream of bitschainer
- Wrappers around common structs that provide chaining APIs (take ownership, do operation, then return back)cli
- CLI arguments parserdefer
- Defer running code until the end of the current scope or until something gets droppedid
- ID generators, of various output sizes, and guarantees of uniqueness and orderingint
- Bigints (ex. u384) and uneven sized ints (ex. u15)iter
- Iterator utilitieslsl
- Experimental lib to help with writing Second Life scripts in Rust… because yes, I got fed up with it very quickly and immediately missed Rust lolmcu
- Material colour utilitiesmemory-usage
- Calculate actual memory usage of Rust structs, including derive macro for custom types (not the same assize_of::<T>()
)minesweeper
- Core logic components for minesweeper games of arbitrary sizenum-traits
- More traits for numbers and their various functionality, including things like [MulWidening
]path
- UTF-8 only path manipulation utilities written from scratchserialiser-binary
- Self describing and stable binary format/serialiser, aiming for small output sizeserialiser-binary-2
- Self describing and stable binary format/serialiser, aiming for small output size (v2)serialiser-text
- Self describing and stable text format/serialiser, aiming to be easy to read and write by handstring-pool
- Global immutable string pool and String type (à la Java)sudoku
- Sudoku related… stuffunicode
- Implementation of the Unicode standard, including UTF-8, UTF-16, and UTF-32 strings
§Platform support
This crate will only officially support macOS and Linux. Windows support will only be on best effort basis. This does not mean I don’t want to support Windows though! Just that my ability to do so is going to be lesser than unix platforms. Still do submit issues though, and you can PR me if you’d like!
§Enabled features (docs.rs)
On docs.rs, the feature all
is enabled. This means that all stable features,
and only stable features, will appear in these docs.
If you would like to see documentation for unstable features, please use
cargo doc
to build them locally (or alternatively cargo doc --open
to
open the locally built docs in your default browser). Running cargo doc
will by default also generate documentation for all crates in your dependency
tree, including wiwi, so no need to clone the wiwi
repository just for
unstable feature docs.
Unstable documentation for the in-development version of wiwi is available at wiwi.kiwin.gay.
Modules§
- _changelog
- changelog
- augment_
panic_ hook augment-panic-hook
- Conveniently augment the panic hook (instead of replacing it), running some of your code before calling the existing one
- clock_
timer clock-timer
- An interval tracking clock, yielding ticks at specified intervals and doing so for a specified period of time
- debounce
debounce
- Delay calling a function until a specified period of time has passed since the last time it was called
- export_
all_ submodules export-all-submodules
- A convenience macro for declaring many private modules, then reexporting everything within them using a glob use statement
- h
h
- h
- hex
hex
- Fast hex encoder and decoder for both upper hex and lower hex
- int
int-unstable
- Bigints (ex. u384) and uneven sized ints (ex. u15)
- lazy_
wrap lazy-wrap
- Wrappers around a lazily initialised value, and its initialisation function, supporting usage in static variables
- nominal
nominal
- Generic newtype wrappers, for increased type safety through Rust’s nominal type system
- num_
traits num-traits-unstable
- More traits for numbers and their various functionality, including things like [
MulWidening
] - prelude
- Prelude module, exporting commonly-used types from enabled features
- rand
rand
- More random number generators and utilities
- with_
cloned with-cloned
- Convenience macro for the clone-and-move pattern (yes, we’re calling it that :p)
- z85
z85
- Fast encoder and decoder for ZeroMQ’s zZ85 format
Macros§
- export_
all_ submodules export-all-submodules
- Convenience macro that declares many private submodules, and glob reexports all items from them
- nominal
nominal
- Declare a new nominal type (alias), with the provided name, a name for the marker type struct, and the wrapped type
- nominal_
mod nominal
- Declare many new nominal types (aliases), in a module
- with_
cloned with-cloned
- Executes code with cloned values, so the executed code can take ownership of the value without moving the original