[−][src]Crate abstutil
The contents of this crate need to be organized better:
- Timer (a mix of logging, profiling, and even parallel execution)
- IO utilities, some of which have web equivalents using include_dir
- Utilities to find A/B Street-specific data
- true utility functions (collections, prettyprinting, CLI parsing
Modules
abst_data | |
abst_paths | Generate paths for different A/B Street files |
cli | |
collections | |
io | |
io_native | Normal file IO using the filesystem |
logger | |
process | |
serde | |
time | |
utils |
Structs
CmdArgs | Yet another barebones command-line flag parsing library. |
Counter | |
DataPacks | Player-chosen groups of files to opt into downloading |
Entry | A single file |
FileWithProgress | |
FixedMap | A drop-in replacement for |
Manifest | A list of all canonical data files for A/B Street that're uploaded somewhere. The file formats are tied to the latest version of the git repo. Players use the updater crate to sync these files with local copies. |
MapName | A single map is identified using this. Using a struct makes refactoring later easier, to organize cities hierarchially. |
MultiMap | |
Tags | Convenience functions around a string->string map |
Timer | Hierarchial magic |
VecMap | Use when your key is just PartialEq, not Ord or Hash. |
Enums
Parallelism |
Constants
PROGRESS_FREQUENCY_SECONDS |
Traits
IndexableKey | Use with |
TimerSink |
Functions
basename | |
clamp | |
clear_current_line | |
contains_duplicates | |
delete_file | Idempotent |
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 |
elapsed_seconds | |
file_exists | |
find_next_file | |
find_prev_file | Keeps file extensions |
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. |
list_all_objects | Just list all things from a directory, return sorted by name, with file extension removed. |
list_dir | Returns full paths |
load_all_objects | Load all serialized things from a directory, return sorted by name, with file extension removed. Detects JSON or binary. Filters out broken files. |
maybe_read_binary | |
maybe_read_json | |
must_read_object | May be a JSON or binary file. Panics on failure. |
must_run_cmd | Runs a command, asserts success. STDOUT and STDERR aren't touched. |
parent_path | |
parse_scenario_path | Extract the map and scenario name from a path. Crashes if the input is strange. |
path | |
path_all_edits | |
path_all_saves | |
path_all_scenarios | |
path_camera_state | |
path_edits | |
path_player | |
path_popdat | |
path_prebaked_results | |
path_raw_map | |
path_save | |
path_scenario | |
plain_list_names | |
prettyprint_time | |
prettyprint_usize | |
read_binary | |
read_json | |
read_object | May be a JSON or binary file |
retain_btreemap | |
retain_btreeset | |
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 |
serialized_size_bytes | The number of bytes for an object serialized to bincode. |
setup | On native: uses env_log |
slurp_file | |
to_json | Stringifies an object to nicely formatted JSON. |
to_json_terse | Stringifies an object to terse JSON. |
wraparound_get | |
write_binary | |
write_json |