pub struct TransferConfig {
pub concurrency: NonZeroUsize,
pub max_bytes_per_sec: Option<u64>,
pub adaptive: AdaptivePolicy,
}Expand description
Configuration for object transfers: how many to run in parallel, an optional aggregate byte-rate cap, and whether to tune those adaptively.
Default auto-detects the available parallelism (capped at
[DEFAULT_CONCURRENCY_CAP]), leaves bandwidth unlimited, and disables
adaptive tuning (AdaptivePolicy::Off).
Fields§
§concurrency: NonZeroUsizeMaximum number of object transfers to run concurrently. In the adaptive
(On) path this is the slow-start seed; the effective in-flight
window is sized to the policy ceiling and gated to the live limit.
max_bytes_per_sec: Option<u64>Optional aggregate bandwidth cap, in bytes per second. None means
unlimited. In the adaptive path this is the rate cap (max_rate); the
controller may target a lower live rate.
adaptive: AdaptivePolicyWhether to tune concurrency / rate adaptively. AdaptivePolicy::Off
(the default) keeps the historical fixed-concurrency path byte-for-byte.
Implementations§
Source§impl TransferConfig
impl TransferConfig
Sourcepub fn new(concurrency: usize, max_bytes_per_sec: Option<u64>) -> Self
pub fn new(concurrency: usize, max_bytes_per_sec: Option<u64>) -> Self
Builds a non-adaptive config, clamping concurrency to at least 1.
The adaptive policy defaults to AdaptivePolicy::Off, so existing
callers behave exactly as before. Use
with_adaptive to opt in.
Sourcepub fn with_adaptive(self, policy: AdaptivePolicy) -> Self
pub fn with_adaptive(self, policy: AdaptivePolicy) -> Self
Returns this config with its adaptive policy set to policy (builder
style). Off is byte-identical to a plain new config.
Trait Implementations§
Source§impl Clone for TransferConfig
impl Clone for TransferConfig
Source§fn clone(&self) -> TransferConfig
fn clone(&self) -> TransferConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TransferConfig
impl Debug for TransferConfig
Auto Trait Implementations§
impl Freeze for TransferConfig
impl RefUnwindSafe for TransferConfig
impl Send for TransferConfig
impl Sync for TransferConfig
impl Unpin for TransferConfig
impl UnsafeUnpin for TransferConfig
impl UnwindSafe for TransferConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request