[−][src]Crate kai
Description
This library contains my person Rust prelude and utilities.
Design goals
- Remove the hassle of having to add
use
statements for very common standard library types - Reduce the amount of code that actually has to be written
- Alleviate common Rust pain points
This library is meant to improve your experience writing Rust no matter what you are writing code for. The patterns it tackles are mostly ones that the average Rust programmer encounters on a daily basis.
Utilities
I have made some very simple utilities to aid in writing Rust code:
BoolMap
A trait intended forbool
s that allows one-line constuction ofOption
svariant!
Maps an enum to an option for use withIterator::filter_map
order
Functions for fully orderingPartialOrd
typesclose
Functions for checking if two floating-point numbers are close enough to be considered equalAdapter
Wraps a reference to a string representation of some type
Modules
close | Functions for checking if two floating-point numbers are close enough to be considered equal |
fs | Filesystem manipulation operations. |
iter | Composable external iteration. |
order | Functions for fully ordering |
thread | Native threads. |
Macros
variant | Maps an enum to an option for use with |
Structs
Adapter | Wraps a reference to a string representation of some type |
Arc | A thread-safe reference-counting pointer. 'Arc' stands for 'Atomically Reference Counted'. |
File | A reference to an open file on the filesystem. |
Formatter | Configuration for formatting. |
HashMap | A hash map implemented with linear probing and Robin Hood bucket stealing. |
HashSet | A hash set implemented as a |
IntoIter | An iterator that moves out of a vector. |
JoinHandle | An owned permission to join on a thread (block on its termination). |
Mutex | A mutual exclusion primitive useful for protecting shared data |
Path | A slice of a path (akin to |
PathBuf | An owned, mutable path (akin to |
Rc | A single-threaded reference-counting pointer. 'Rc' stands for 'Reference Counted'. |
Enums
Ordering | An |
Constants
PI32 | Archimedes' constant (π) |
PI64 | Archimedes' constant (π) |
Traits
BoolMap | A trait intended for |
BufRead | A |
Debug |
|
Deref | Used for immutable dereferencing operations, like |
DerefMut | Used for mutable dereferencing operations, like in |
Display | Format trait for an empty format, |
Error |
|
FromStr | Parse a value from a string |
Index | Used for indexing operations ( |
IndexMut | Used for indexing operations ( |
Read | The |
Write | A trait for objects which are byte-oriented sinks. |
Type Definitions
FmtResult | The type returned by formatter methods. |
IoResult | A specialized |