pub struct Builder { /* private fields */ }
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn new() -> Builder
pub fn new() -> Builder
Initializes a new sources::Builder that can be used to add commands to an API request
The builder does not do validity checking of the arguments nor does it check for duplicates.
use fred_rs::sources::Builder;
// Create a new builder
let mut builder = Builder::new();
// add arguments to the builder
builder
.realtime_start("1900-01-01")
.realtime_end("2000-01-01");
Sourcepub fn realtime_start(&mut self, start_date: &str) -> &mut Builder
pub fn realtime_start(&mut self, start_date: &str) -> &mut Builder
Adds a realtime_start argument to the builder
§Arguments
start_date
- date formatted as YYYY-MM-DD
https://research.stlouisfed.org/docs/api/fred/sources.html#realtime_start
Sourcepub fn realtime_end(&mut self, end_date: &str) -> &mut Builder
pub fn realtime_end(&mut self, end_date: &str) -> &mut Builder
Adds a realtime_end argument to the builder
§Arguments
end_date
- date formatted as YYYY-MM-DD
https://research.stlouisfed.org/docs/api/fred/sources.html#realtime_end
Sourcepub fn limit(&mut self, num_results: usize) -> &mut Builder
pub fn limit(&mut self, num_results: usize) -> &mut Builder
Adds a limit argument to the builder
The limit argument specifies a maximum number of observations to return.
§Arguments
num_results
- Maximum number of results to return
https://research.stlouisfed.org/docs/api/fred/sources.html#limit
Sourcepub fn offset(&mut self, ofs: usize) -> &mut Builder
pub fn offset(&mut self, ofs: usize) -> &mut Builder
Adds an offset argument to the builder
Adding an offset shifts the starting result number. For example, if limit is 5 and offset is 0 then results 1-5 will be returned, but if offset was 5 then results 6-10 would be returned.
https://research.stlouisfed.org/docs/api/fred/sources.html#offset
§Arguments
ofs
- the offset amount
https://research.stlouisfed.org/docs/api/fred/sources.html#offset
Sourcepub fn order_by(&mut self, order: OrderBy) -> &mut Builder
pub fn order_by(&mut self, order: OrderBy) -> &mut Builder
Adds the search_type argument to the request
§Arguments
order
- result ranking system
https://research.stlouisfed.org/docs/api/fred/sources.html#order_by
Sourcepub fn sort_order(&mut self, order: SortOrder) -> &mut Builder
pub fn sort_order(&mut self, order: SortOrder) -> &mut Builder
Change the sort order of the data
§Arguments
order
- Data sort order enum
https://research.stlouisfed.org/docs/api/fred/sources.html#sort_order