Skip to main content

Crate bears_ecology

Crate bears_ecology 

Source

Structs§

App
The App struct contains the application state.
Chunk
Chunks
Event
History
The History struct contains a log of Event data stored as values in a BTreeMap, using the Event path as the key.
Options
The Options struct holds values for parameters in a BEA request.
Queue
SizeEvent
Style
Tracker

Enums§

Mode
Overwrite
Represents intent to overwite existing files in the BEA_DATA directory during download operations on a Queue.
ParameterKind
The ParameterKind enum exists to provide a single source of truth for how to spell the parameter value that functions as the header for a given parameter.
Request
ResultStatus
The ResultStatus enum represents different possible outcomes for async load and download tasks. Used when asynchronous processes need to provide a return value indicating the outcome status of their task. The primary purpose is for logging and to aid in control flow when managing tasks.
Scope
Represents the scope of retain operations on a Queue. If condition C is the filter for a subset S of queue Q, then S has Scope::Queue. Let T be the subset of S that is also contained in the History H, so that Q ⊃ S ⊃ T, where C is true for S, and T ⊂ H. We use Scope::History to represent the subset T.

Functions§

bea_data
download_with_history
file_size
get_datasets
Download the BEA dataset parameter values into the BEA_DATA directory.
init
Helper function Initiates logging Reads environmental variables from .env Creates an instance of App
init_queue
initial_download
initial_load
Load all successfully downloaded files in the download History for the Dataset. If the user provides a load_history, the method will exclude previously loaded files in the provided History.
parameter_values
The parameter_values method requests the valid range of values for each parameter in the Dataset.
parameters
For each variant of Dataset, request the parameters. Write the results in JSON format to the BEA_DATA directory.
retry_load
Tries to load any files in the history that previously failed to load.
trace_init
Initiates a subscriber for the tracing library. Used to instrument internal library functions for debugging and diagnostics.
values
For each variant of Dataset, request the valid range of values for each parameter name. BEA has not implemented this method for all parameters, so we expect some calls to fail.
values_gdp
The values_gdp method downloads the valid parameter values for Dataset::GDPbyIndustry variant.
values_subset
For each variant of Dataset, request the valid range of values for each parameter name. The subset variant of this method only requests data for datasets where the BEA has implemented a response for each parameter name associated with the dataset.
values_ugdp
The values_ugdp method downloads the valid parameter values for Dataset::UnderlyingGDPbyIndustry variant.