Expand description
The contents of this crate need to be organized better:
- Timer (a mix of logging, profiling, and even parallel execution)
- true utility functions (collections, prettyprinting, CLI parsing
Re-exports§
Modules§
- cli 🔒
- clone 🔒
- collections 🔒
- logger
- priority_
queue 🔒 - process 🔒
- serde 🔒
- time
- utils 🔒
Structs§
- Counter
- A counter per key
- Fixed
Map - A drop-in replacement for
BTreeMap
, where the keys have the property of being array indices. Some values may be missing. Much more efficient at operations on individual objects, because it just becomes a simple array lookup. - Multi
Map - Priority
Queue Item - Use with
BinaryHeap
. Since it’s a max-heap, reverse the comparison to get the smallest cost first. - Tags
- Convenience functions around a string->string map
- VecMap
- Use when your key is just PartialEq, not Ord or Hash.
Constants§
Traits§
- Cloneable
Any - Trick to make a cloneable Any from https://stackoverflow.com/questions/30353462/how-to-clone-a-struct-storing-a-boxed-trait-object/30353928#30353928.
- Cloneable
Impl - Indexable
Key - Use with
FixedMap
. From a particular key, extract ausize
. These values should be roughly contiguous; the space used by theFixedMap
will beO(n)
with respect to the largest value returned here.
Functions§
- abbreviated_
format - args_
to_ query_ string - Transforms some command-line arguments into URL query parameters, using
&
as the separator between arguments. The string returned starts with?
, unless the arguments are all empty. - basename
- cli_
args - Returns arguments passed in from the command-line, starting with the program name.
- contains_
duplicates - deserialize_
btreemap - Deserializes a BTreeMap from a list of tuples. Necessary when the keys are structs; see https://github.com/serde-rs/json/issues/402.
- deserialize_
hashmap - Deserializes a HashMap from a list of tuples.
- deserialize_
multimap - Deserializes a MultiMap.
- deserialize_
usize - Deserializes a
usize
from au32
. - from_
binary - Deserializes an object from the bincode format.
- from_
binary_ reader - Deserializes an object from the bincode format, from a reader.
- from_
json - Deserializes an object from a JSON string.
- from_
json_ reader - Deserializes an object from JSON, from a reader.
- must_
run_ cmd - Runs a command, asserts success. STDOUT and STDERR aren’t touched.
- parent_
path - plain_
list_ names - prettyprint_
bytes - prettyprint_
usize - serialize_
btreemap - Serializes a BTreeMap as a list of tuples. Necessary when the keys are structs; see https://github.com/serde-rs/json/issues/402.
- serialize_
hashmap - Serializes a HashMap as a list of tuples, first sorting by the keys. This ensures the serialized form is deterministic.
- serialize_
multimap - Serializes a MultiMap.
- serialize_
usize - Serializes a
usize
as au32
to save space. Useful when you needusize
for indexing, but the values don’t exceed 2^32. - serialized_
size_ bytes - The number of bytes for an object serialized to bincode.
- to_
binary - Transforms an object to bincoded bytes.
- to_json
- Stringifies an object to nicely formatted JSON.
- to_
json_ terse - Stringifies an object to terse JSON.
- wraparound_
get