pub struct Downloader<S> { /* private fields */ }Expand description
Manifests downloader and parser.
Implementations§
Source§impl<'a> Downloader<DefaultSource<'a>>
impl<'a> Downloader<DefaultSource<'a>>
Sourcepub fn with_default_source(channel: &'a str) -> Self
pub fn with_default_source(channel: &'a str) -> Self
Create a new instance of the Downloader with a DefaultSource.
Source§impl<S> Downloader<S>
impl<S> Downloader<S>
Sourcepub fn new(source: S) -> Self
pub fn new(source: S) -> Self
Create a new instance of the Downloader with a provided instance of SourceInfo.
Source§impl<S> Downloader<S>where
S: SourceInfo,
impl<S> Downloader<S>where
S: SourceInfo,
Sourcepub fn set_cache(self, c: FsCache) -> Downloader<S>
pub fn set_cache(self, c: FsCache) -> Downloader<S>
Sets a cache for the downloader. By default a [NoopCache] is used.
Sourcepub fn skip_missing_days(self, skip: usize) -> Downloader<S>
pub fn skip_missing_days(self, skip: usize) -> Downloader<S>
Set to non zero if you want to silently skip days for which manifest files are missing.
Not more than skip days will be skipped.
Please not that this setting only affects the [get_last_manifests] method.
Off (zero) by default.
Sourcepub fn get_last_manifests(&self, days: usize) -> Result<Vec<Manifest>, Error>
pub fn get_last_manifests(&self, days: usize) -> Result<Vec<Manifest>, Error>
Get latest available manifests for given days. If days is 0 or 1 only the latest
manifest is fetched.
The returned vector is sorted in descending order of dates.
Sourcepub fn get_manifest(&self, day: NaiveDate) -> Result<Manifest, Error>
pub fn get_manifest(&self, day: NaiveDate) -> Result<Manifest, Error>
Gets manifest for a given date.
Sourcepub fn get_latest_manifest(&self) -> Result<Manifest, Error>
pub fn get_latest_manifest(&self) -> Result<Manifest, Error>
Gets manifest for a given date. If the date is None, the latest available manifest is
requested.
This call is never cached.