Skip to main content

TransferConfig

Struct TransferConfig 

Source
pub struct TransferConfig {
Show 15 fields pub compression_level: u32, pub exclude_patterns: Vec<String>, pub ssh_server_alive_interval_secs: Option<u64>, pub ssh_control_persist_secs: Option<u64>, pub remote_base: String, pub retry: RetryConfig, pub verify_artifacts: bool, pub verify_max_size_bytes: u64, pub max_transfer_mb: Option<u64>, pub max_transfer_time_ms: Option<u64>, pub bwlimit_kbps: Option<u64>, pub estimated_bandwidth_bps: Option<u64>, pub adaptive_compression: bool, pub min_compression_level: u32, pub max_compression_level: u32,
}

Fields§

§compression_level: u32

zstd compression level (1-19).

§exclude_patterns: Vec<String>

Patterns to exclude from transfer.

§ssh_server_alive_interval_secs: Option<u64>

SSH keepalive interval in seconds (ssh -o ServerAliveInterval=<N>).

When unset, OpenSSH defaults apply (keepalive disabled).

§ssh_control_persist_secs: Option<u64>

SSH ControlPersist idle timeout in seconds (ssh -o ControlPersist=<N>s).

  • Unset preserves OpenSSH defaults (ControlPersist enabled by default via mux).
  • 0 disables persistence (ControlPersist=no).
§remote_base: String

Remote base directory for project sync and build execution. Must be an absolute path. Defaults to /tmp/rch.

§retry: RetryConfig

Retry policy for transient network errors during transfer.

§verify_artifacts: bool

Verify artifact integrity using blake3 hashes after transfer (bd-377q).

When enabled, computes blake3 hashes of key artifacts (binaries, test outputs) on the worker after build, then verifies them locally after download. Disabled by default to avoid extra overhead.

§verify_max_size_bytes: u64

Maximum file size (bytes) for artifact verification (bd-377q).

Files larger than this limit are skipped during verification to avoid excessive I/O. Defaults to 100MB.

§max_transfer_mb: Option<u64>

Maximum transfer size in MB before skipping remote execution.

When set, runs rsync --dry-run --stats to estimate transfer size. If the estimated size exceeds this threshold, remote offload is skipped and the command runs locally. Set to None (default) to disable.

§max_transfer_time_ms: Option<u64>

Maximum estimated transfer time in milliseconds before skipping remote.

Uses estimated_bandwidth_bps (or measured link speed) to calculate expected transfer time. If it exceeds this threshold, remote offload is skipped. Set to None (default) to disable.

§bwlimit_kbps: Option<u64>

Bandwidth limit for rsync in KB/s.

Passed as rsync --bwlimit=<N> to limit transfer speed and prevent network saturation. Set to None or 0 (default) for unlimited.

§estimated_bandwidth_bps: Option<u64>

Estimated link bandwidth in bytes per second.

Used for transfer time estimation when max_transfer_time_ms is set. If not provided, defaults to 10 MB/s (10485760 bytes/sec).

§adaptive_compression: bool

Enable adaptive zstd compression based on transfer size (bd-243w).

When enabled, automatically selects compression level based on estimated payload size:

  • < 10MB: level 1 (fast, minimal compression)
  • 10-200MB: level 3 (balanced, default)
  • 200MB: level 7 (slower, better compression)

When disabled (default), uses the fixed compression_level setting.

§min_compression_level: u32

Minimum compression level for adaptive mode (bd-243w).

Even in adaptive mode, compression level won’t go below this. Defaults to 1.

§max_compression_level: u32

Maximum compression level for adaptive mode (bd-243w).

Even in adaptive mode, compression level won’t exceed this. Defaults to 9 (avoids CPU-intensive levels 10+).

Implementations§

Source§

impl TransferConfig

Source

pub fn select_compression_level(&self, estimated_bytes: Option<u64>) -> u32

Select compression level based on estimated transfer size (bd-243w).

When adaptive compression is enabled, selects an appropriate level based on payload size:

  • < 10MB: level 1 (fast, minimal compression)
  • 10-200MB: level 3 (balanced)
  • 200MB: level 7 (better compression)

The result is clamped between min_compression_level and max_compression_level.

When adaptive compression is disabled, returns the fixed compression_level.

Trait Implementations§

Source§

impl Clone for TransferConfig

Source§

fn clone(&self) -> TransferConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TransferConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TransferConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for TransferConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for TransferConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,