Expand description
A/B Street organizes data files in a particular way. This crate implements methods to find files and (mostly) treat them the same way on native and web.
Modules§
- abst_
data 🔒 - abst_
paths 🔒 - Generate paths for different A/B Street files
- download 🔒
- http 🔒
- io 🔒
- io_
native 🔒 - Normal file IO using the filesystem
Structs§
- City
Name - A single city is identified using this.
- Data
Packs - Player-chosen groups of files to opt into downloading
- Entry
- A single file
- File
With Progress - 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.
Functions§
- delete_
file - Idempotent
- download_
bytes - Downloads bytes from a URL. This must be called with a tokio runtime somewhere. The caller creates an mpsc channel pair and provides the sender. Progress will be described through it.
- download_
to_ file - Download a file from a URL. This must be called with a tokio runtime somewhere. Progress will be printed to STDOUT.
- file_
exists - find_
next_ file - find_
prev_ file - Keeps file extensions
- http_
get - Performs an HTTP GET request and returns the raw response. Unlike the variations in download.rs, no progress – but it works on native and web.
- http_
post - Performs an HTTP POST request and returns the response.
- 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.
- parse_
scenario_ path - Extract the map and scenario name from a path. Crashes if the input is strange.
- path
- path_
all_ edits - path_
all_ ltn_ proposals - path_
all_ saves - path_
all_ scenarios - path_
camera_ state - path_
edits - path_
ltn_ proposals - path_
player - path_
popdat - path_
prebaked_ results - path_
raw_ map - path_
save - path_
scenario - path_
shared_ input - path_
trips - print_
download_ progress - Print download progress to STDOUT. Pass this the receiver, then call download_to_file or download_bytes with the sender.
- read_
binary - read_
json - read_
object - May be a JSON or binary file
- slurp_
bytes - An adapter for widgetry::Settings::read_svg to read SVGs using this crate’s methods for finding and reading files in different environments.
- slurp_
file - write_
binary - write_
file - Returns path on success
- write_
json - write_
raw