pub struct FetchPolicy {
pub attempts_per_peer: usize,
pub request_timeout: Duration,
pub max_chunks_per_peer: usize,
pub failure_backoff_base: Duration,
pub max_backoff: Duration,
pub parallel_chunks: usize,
pub max_stall_rounds: usize,
pub initial_reputations: HashMap<String, i32>,
}Fields§
§attempts_per_peer: usize§request_timeout: Duration§max_chunks_per_peer: usize§failure_backoff_base: Duration§max_backoff: Duration§parallel_chunks: usizeMaximum number of chunk requests in flight at once across all peers. Higher values improve throughput when multiple peers are available.
max_stall_rounds: usizeMaximum consecutive stall loops (each separated by failure_backoff_base)
before a download is aborted. A stall loop fires whenever no chunks are
in-flight because every peer is currently in back-off. Default: 60
(≈ 18 s at the 300 ms default back-off base).
initial_reputations: HashMap<String, i32>Optional seed reputation scores keyed by the peer’s canonical string
("<ip>:<port>:<transport>"). When present, a peer’s
PeerRuntimeStats.score is initialised from this map so that
historically reliable peers are tried before less-trusted ones.
Trait Implementations§
Source§impl Clone for FetchPolicy
impl Clone for FetchPolicy
Source§fn clone(&self) -> FetchPolicy
fn clone(&self) -> FetchPolicy
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 moreSource§impl Debug for FetchPolicy
impl Debug for FetchPolicy
Auto Trait Implementations§
impl Freeze for FetchPolicy
impl RefUnwindSafe for FetchPolicy
impl Send for FetchPolicy
impl Sync for FetchPolicy
impl Unpin for FetchPolicy
impl UnsafeUnpin for FetchPolicy
impl UnwindSafe for FetchPolicy
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