pub struct Downloader { /* private fields */ }Implementations§
Source§impl Downloader
impl Downloader
pub fn new(store: &Store, endpoint: &Endpoint) -> Self
pub fn new_with_opts( store: &Store, endpoint: &Endpoint, pool_options: Options, ) -> Self
pub fn download( &self, request: impl SupportedRequest, providers: impl ContentDiscovery, ) -> DownloadProgress
pub fn download_with_opts(&self, options: DownloadOptions) -> DownloadProgress
Sourcepub async fn wait_idle(&self) -> Result<()>
pub async fn wait_idle(&self) -> Result<()>
Wait until the downloader has no in-flight download tasks.
This is mostly useful for tests, where you want to confirm that all previously-issued downloads have settled (whether they completed successfully or errored out). Note that the downloader is not guaranteed to become idle if it is being interacted with concurrently; in that case this might wait forever. Also note that once you get the callback, the downloader is not guaranteed to still be idle — all this tells you is that there was a point in time, between the call and the response, where it was idle.
Trait Implementations§
Source§impl Clone for Downloader
impl Clone for Downloader
Source§fn clone(&self) -> Downloader
fn clone(&self) -> Downloader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Downloader
impl !RefUnwindSafe for Downloader
impl Send for Downloader
impl Sync for Downloader
impl Unpin for Downloader
impl UnsafeUnpin for Downloader
impl !UnwindSafe for Downloader
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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