pub struct SourceSet { /* private fields */ }Expand description
The set of usable sources for one download, with least-failures selection so a flaky mirror drains itself out of rotation without being banned outright.
Implementations§
Source§impl SourceSet
impl SourceSet
Sourcepub fn new(sources: Vec<Source>) -> Self
pub fn new(sources: Vec<Source>) -> Self
Keeps only usable sources. The primary is always first.
pub fn single(url: Url, validator: Option<String>) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn urls(&self) -> Vec<String>
Sourcepub fn pick(&self) -> (usize, &Source)
pub fn pick(&self) -> (usize, &Source)
Pick a source: fewest failures wins, ties broken round-robin so several workers starting at once spread across mirrors.
pub fn penalise(&self, idx: usize)
pub fn reward(&self, idx: usize)
Auto Trait Implementations§
impl !Freeze for SourceSet
impl RefUnwindSafe for SourceSet
impl Send for SourceSet
impl Sync for SourceSet
impl Unpin for SourceSet
impl UnsafeUnpin for SourceSet
impl UnwindSafe for SourceSet
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