pub struct WorkerCtx {Show 13 fields
pub client: Client,
pub sources: Arc<SourceSet>,
pub file: Arc<DestFile>,
pub scheduler: Arc<Scheduler>,
pub reporter: Reporter,
pub retry: RetryPolicy,
pub limiter: Option<Arc<RateLimiter>>,
pub read_timeout: Duration,
pub expected_total: Option<u64>,
pub ranges_supported: bool,
pub discovered_size: Arc<AtomicU64>,
pub cancel: Cancel,
pub primed: Mutex<Option<PrimedBody>>,
}Expand description
Everything a worker needs, shared by Arc across all of them.
Fields§
§client: Client§sources: Arc<SourceSet>§file: Arc<DestFile>§scheduler: Arc<Scheduler>§reporter: Reporter§retry: RetryPolicy§limiter: Option<Arc<RateLimiter>>§read_timeout: DurationMaximum silence between two body chunks before we call it a timeout.
expected_total: Option<u64>§ranges_supported: boolWhen false we never send a Range header at all — asking a server that
ignores ranges for one guarantees a 200 with the whole body, which we
would (correctly) reject as a protocol violation.
discovered_size: Arc<AtomicU64>Filled in when an open-ended (unknown length) transfer discovers the real size by reaching the end of the body.
cancel: Cancel§primed: Mutex<Option<PrimedBody>>The response the priming probe left open, whose body starts at byte 0. Whichever worker first picks up a lease sitting at byte 0 transfers it instead of opening a redundant connection. Taken at most once.
Auto Trait Implementations§
impl !Freeze for WorkerCtx
impl !RefUnwindSafe for WorkerCtx
impl !UnwindSafe for WorkerCtx
impl Send for WorkerCtx
impl Sync for WorkerCtx
impl Unpin for WorkerCtx
impl UnsafeUnpin for WorkerCtx
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