DownloadParams

The parameter struct and builder for HistoricalClient::batch::download.

The builder can be instantiated with the associated function builder(), and the struct is created from the builder with the build() method. For every field, there is an identically named setter method on the builder.

Fields

Parameter
Type
Description
output_dir
PathBuf
The directory to download the file(s) to.
job_id
String
The batch job identifier.
filename_to_download
Option<String>
The specific file to download. If None then will download all files for the batch job.
API method
pub struct DownloadParams {
    pub output_dir: PathBuf,
    pub job_id: String,
    pub filename_to_download: Option<String>,
}
Example usage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::path::PathBuf;

use databento::historical::batch::DownloadParams;
use time::macros::datetime;

assert_eq!(
    DownloadParams {
        output_dir: PathBuf::from("/tmp"),
        job_id: "GLBX-20230926-ANMGJK7JB6".to_owned(),
        filename_to_download: None,
    },
    DownloadParams::builder()
        .output_dir("/tmp")
        .job_id("GLBX-20230926-ANMGJK7JB6")
        .build()
);