Struct iroh_blobs::downloader::Downloader
source · pub struct Downloader { /* private fields */ }
Available on crate feature
downloader
only.Expand description
Handle for the download services.
Implementations§
source§impl Downloader
impl Downloader
sourcepub fn new<S>(store: S, endpoint: Endpoint, rt: LocalPoolHandle) -> Selfwhere
S: Store,
pub fn new<S>(store: S, endpoint: Endpoint, rt: LocalPoolHandle) -> Selfwhere
S: Store,
Create a new Downloader with the default ConcurrencyLimits
and RetryConfig
.
sourcepub fn with_config<S>(
store: S,
endpoint: Endpoint,
rt: LocalPoolHandle,
concurrency_limits: ConcurrencyLimits,
retry_config: RetryConfig
) -> Selfwhere
S: Store,
pub fn with_config<S>(
store: S,
endpoint: Endpoint,
rt: LocalPoolHandle,
concurrency_limits: ConcurrencyLimits,
retry_config: RetryConfig
) -> Selfwhere
S: Store,
Create a new Downloader with custom ConcurrencyLimits
and RetryConfig
.
sourcepub async fn queue(&self, request: DownloadRequest) -> DownloadHandle ⓘ
pub async fn queue(&self, request: DownloadRequest) -> DownloadHandle ⓘ
Queue a download.
sourcepub async fn cancel(&self, handle: DownloadHandle)
pub async fn cancel(&self, handle: DownloadHandle)
Cancel a download.
sourcepub async fn nodes_have(&mut self, hash: Hash, nodes: Vec<NodeId>)
pub async fn nodes_have(&mut self, hash: Hash, nodes: Vec<NodeId>)
Declare that certain nodes can be used to download a hash.
Note that this does not start a download, but only provides new nodes to already queued
downloads. Use Self::queue
to queue a download.
Trait Implementations§
source§impl Clone for Downloader
impl Clone for Downloader
source§fn clone(&self) -> Downloader
fn clone(&self) -> Downloader
Returns a copy 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 UnwindSafe for Downloader
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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