pub struct ClientConfig {
pub concurrency: usize,
pub compress: bool,
pub chunk_size: u64,
pub max_retries: u32,
pub base_retry_delay_ms: u32,
pub max_retry_delay_ms: u32,
pub timeout_ms: u32,
}Expand description
Runtime configuration of the WASM engine.
Fields§
§concurrency: usizeMaximum number of concurrent chunk/file transfers (default 4).
compress: boolRequest zrip compression from the server / compress uploads.
chunk_size: u64Fixed chunk size used to slice files (default 2 MiB).
max_retries: u32Maximum retries per chunk/file (default 3).
base_retry_delay_ms: u32Initial backoff delay in ms (default 500).
max_retry_delay_ms: u32Backoff ceiling in ms (default 30s).
timeout_ms: u32Per-request timeout in ms (default 60s).
Implementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub fn from_js(opts: &JsValue) -> ClientConfig
pub fn from_js(opts: &JsValue) -> ClientConfig
Parse configuration from a JS object literal, e.g.
{ concurrency: 4, compress: true, chunkSize: 2097152 }.
Safe to call with null/undefined (returns defaults) — this also
keeps native (non-wasm) unit tests runnable.
Sourcepub fn backoff_ms(&self, attempt: u32) -> u32
pub fn backoff_ms(&self, attempt: u32) -> u32
Exponential backoff delay for a failed attempt (0-based).
2^attempt * base, clamped to max. Bounded so a hung peer cannot
grow the delay without limit.
Trait Implementations§
Source§impl Clone for ClientConfig
impl Clone for ClientConfig
Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ClientConfig
impl Debug for ClientConfig
Auto Trait Implementations§
impl Freeze for ClientConfig
impl RefUnwindSafe for ClientConfig
impl Send for ClientConfig
impl Sync for ClientConfig
impl Unpin for ClientConfig
impl UnsafeUnpin for ClientConfig
impl UnwindSafe for ClientConfig
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