pub struct DownloadConfig<'download, Reporter>where
Reporter: DownloadReporter,{
pub output_path: &'download Path,
pub reporter: Option<&'download Reporter>,
pub max_simultaneous_downloads: usize,
pub access_token: Option<Cow<'download, str>>,
}Expand description
Contains the configuration for a downloading operation.
Fields§
§output_path: &'download PathThe directory that the tree will be downloaded into.
reporter: Option<&'download Reporter>If provided, the reporter will receive events on the status of each download.
max_simultaneous_downloads: usizeThe maximum number of simultaneous downloads allowed at once. The default is 5.
access_token: Option<Cow<'download, str>>Your GitHub personal access token, if you have one.
Implementations§
Source§impl<'download, Reporter> DownloadConfig<'download, Reporter>where
Reporter: DownloadReporter,
impl<'download, Reporter> DownloadConfig<'download, Reporter>where
Reporter: DownloadReporter,
Sourcepub fn new(output_path: &'download Path) -> DownloadConfig<'download, Reporter>
pub fn new(output_path: &'download Path) -> DownloadConfig<'download, Reporter>
Creates a new DownloadConfig with the given output path and default values.
access_token will be read from the environment variable GITHUB_ACCESS_TOKEN if available.
Sourcepub fn new_with_reporter(
output_path: &'download Path,
reporter: &'download Reporter,
) -> DownloadConfig<'download, Reporter>
pub fn new_with_reporter( output_path: &'download Path, reporter: &'download Reporter, ) -> DownloadConfig<'download, Reporter>
Creates a new DownloadConfig with the given output path, reporter, and default values.
access_token will be read from the environment variable GITHUB_ACCESS_TOKEN if available.
Auto Trait Implementations§
impl<'download, Reporter> Freeze for DownloadConfig<'download, Reporter>
impl<'download, Reporter> RefUnwindSafe for DownloadConfig<'download, Reporter>where
Reporter: RefUnwindSafe,
impl<'download, Reporter> Send for DownloadConfig<'download, Reporter>
impl<'download, Reporter> Sync for DownloadConfig<'download, Reporter>
impl<'download, Reporter> Unpin for DownloadConfig<'download, Reporter>
impl<'download, Reporter> UnwindSafe for DownloadConfig<'download, Reporter>where
Reporter: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more