pub struct FetchLimits {
pub max_metadata_bytes: usize,
pub max_artifact_bytes: u64,
pub connect_timeout: Duration,
pub total_timeout: Duration,
}Expand description
Caller-provided byte and time bounds for one fetch.
Fields§
§max_metadata_bytes: usizeMaximum decoded metadata bytes held in memory.
max_artifact_bytes: u64Maximum artifact bytes written to disk. Every fetch is finitely bounded.
connect_timeout: DurationDeadline for establishing the connection (advisory for fixtures).
total_timeout: DurationTotal wall-clock deadline for the fetch.
Implementations§
Source§impl FetchLimits
impl FetchLimits
Sourcepub fn validate(&self) -> Result<(), AcquisitionError>
pub fn validate(&self) -> Result<(), AcquisitionError>
Validates caller-provided byte and time bounds.
The fields remain public for 0.1.x source compatibility, so every transport validates limits again at its I/O boundary. Invalid direct struct literals are rejected before route, filesystem, or network I/O.
Sourcepub fn new(
max_metadata_bytes: usize,
max_artifact_bytes: u64,
connect_timeout: Duration,
total_timeout: Duration,
) -> Result<Self, AcquisitionError>
pub fn new( max_metadata_bytes: usize, max_artifact_bytes: u64, connect_timeout: Duration, total_timeout: Duration, ) -> Result<Self, AcquisitionError>
Creates limits with explicit bounds.
Requires non-zero connect_timeout and total_timeout with
connect_timeout <= total_timeout. The connect phase is part of the
total wall-clock budget, so a connect deadline beyond the total
deadline cannot be satisfied truthfully.
Sourcepub fn effective(
&self,
adapter_connect_ceiling: Duration,
adapter_total_ceiling: Duration,
) -> (Duration, Duration)
pub fn effective( &self, adapter_connect_ceiling: Duration, adapter_total_ceiling: Duration, ) -> (Duration, Duration)
Derives the authoritative effective deadlines for one fetch.
effective connect timeout = min(request connect, adapter connect ceiling)
effective total timeout = min(request total, adapter total ceiling)A stricter adapter ceiling is allowed; an adapter may never silently extend a caller deadline. Both metadata and artifact operations use the same derivation, and the effective total deadline covers response headers plus body streaming.