pub struct PullConfig {
pub read_ahead_bytes: u64,
pub streamer_lane_cap: usize,
}Expand description
Zero-config tunables shared by the consumption faces.
Overrides are opt-in: PullConfig::default is the whole configuration a
caller needs. Override a field with struct-update syntax:
use decdn_client::PullConfig;
// Let a stream run 64 MiB ahead of its reader instead of the default.
let config = PullConfig {
read_ahead_bytes: 64 * 1024 * 1024,
..PullConfig::new()
};
assert_eq!(config.streamer_lane_cap, PullConfig::new().streamer_lane_cap);Fields§
§read_ahead_bytes: u64The Streamer’s bounded read-ahead: the maximum number of bytes fetched
AHEAD of the consumer’s read cursor. Because every fetched byte is paid,
this read-ahead bound is also the outstanding-spend bound for a stream the
consumer abandons early — fetch a two-hour movie’s first read_ahead_bytes
only, not the whole thing, for a viewer who stops after five minutes. A
value below [crate::pacer::PULL_WINDOW_FLOOR] is raised to it: a smaller
window cannot keep a paid leg moving. The Downloader ignores it and
fetches the whole blob at full throughput.
streamer_lane_cap: usizeThe Streamer’s provider-lane cap: how many discovered holders it fetches
the front across at once (the acquire loop’s max_lanes). Small by design
— a paced stream wants a little same-region parallelism on the front, not
the wide striping a full download does. The Downloader runs one lane
per holder instead.
Implementations§
Source§impl PullConfig
impl PullConfig
Trait Implementations§
Source§impl Clone for PullConfig
impl Clone for PullConfig
impl Copy for PullConfig
Source§impl Debug for PullConfig
impl Debug for PullConfig
Source§impl Default for PullConfig
impl Default for PullConfig
impl Eq for PullConfig
Source§impl PartialEq for PullConfig
impl PartialEq for PullConfig
impl StructuralPartialEq for PullConfig
Auto Trait Implementations§
impl Freeze for PullConfig
impl RefUnwindSafe for PullConfig
impl Send for PullConfig
impl Sync for PullConfig
impl Unpin for PullConfig
impl UnsafeUnpin for PullConfig
impl UnwindSafe for PullConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more