pub struct Downloader { /* private fields */ }Expand description
Unified downloader — sole HTTP client owner and fetch orchestrator.
Created once at the application level, then shared (via Clone) across
protocol configs. Owns the HttpClient and the runtime handle.
Protocols obtain a PeerHandle via register and
issue fetches through PeerHandle::execute.
Implementations§
Source§impl Downloader
impl Downloader
Sourcepub fn new(config: DownloaderConfig) -> Self
pub fn new(config: DownloaderConfig) -> Self
Create a new downloader from configuration.
Adopts config.client (a clone of the caller’s HttpClient)
and the shared AbrController from config.abr_settings.
Sourcepub fn register(&self, peer: Arc<dyn Peer>) -> PeerHandle
pub fn register(&self, peer: Arc<dyn Peer>) -> PeerHandle
Register a peer and return its PeerHandle.
Double-registers the peer: fetch channel through the download loop
and ABR state through the shared controller. The returned handle’s
Drop unregisters both.
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 (const: unstable) · 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