pub struct Config {Show 18 fields
pub chunk_size: usize,
pub streams: usize,
pub workers: usize,
pub queue_depth: usize,
pub compression: CompressionConfig,
pub secrecy: Secrecy,
pub cipher: Cipher,
pub verify_hashes: bool,
pub resume: bool,
pub preallocate: bool,
pub delta: bool,
pub trust_mtime: bool,
pub sparse: bool,
pub chunk_hash_budget: usize,
pub max_frame_bytes: usize,
pub max_manifest_entries: usize,
pub handshake_timeout: Duration,
pub preserve_metadata: bool,
}Fields§
§chunk_size: usizePayload bytes per chunk before compression. Chunks are the unit of parallelism, resume, and AEAD sealing.
streams: usizeConcurrent data streams. Each is an independent QUIC unidirectional stream, so head-of-line blocking is per stream, not per transfer.
workers: usizeCPU workers for compress/encrypt (sender) and decrypt/decompress (receiver). Defaults to the core count.
queue_depth: usizeChunks allowed in flight per stream between the CPU stage and the wire. This is what bounds memory: peak ≈ streams * queue_depth * chunk_size.
compression: CompressionConfig§secrecy: Secrecy§cipher: Cipher§verify_hashes: boolVerify each file’s BLAKE3 hash on the receiver after the last chunk lands.
resume: boolWrite a sidecar state file so an interrupted transfer resumes instead of restarting.
preallocate: boolAsk the filesystem to reserve space up front. Avoids fragmentation and surfaces ENOSPC before the first byte crosses the network.
delta: boolReuse blocks the receiver already has from an older copy of a file.
The receiver hashes whatever is already at the destination and tells the sender; the sender recognises matching chunks and sends 28 bytes instead of a megabyte. Changing one byte of a large file then costs one chunk, not the whole file. Costs one read of the existing copy on the receiver.
trust_mtime: boolRemember chunk hashes between runs, keyed by size and modification time.
Without it, delta sync re-reads and re-hashes every file on both ends
every time. With it, an unchanged file costs a stat. The trade is that
a file edited within the timestamp’s resolution and left the same
length would go unnoticed; the receiver’s hash check still catches it as
a failed transfer rather than a corrupt file.
sparse: boolDetect all-zero chunks and send them as a flag instead of as data. Turns a sparse or preallocated file — VM images, database files, preallocated media containers — into a transfer proportional to the data it actually holds, and reproduces the holes on the far side. The scan costs one pass over memory the sender has already read.
chunk_hash_budget: usizeCeiling on the bytes of chunk hashes offered for one file’s reuse index. Past this the index costs more to announce than it can save.
max_frame_bytes: usizeCap on a single frame’s payload. Rejects hostile length prefixes.
max_manifest_entries: usizeCeiling on entries in one manifest.
handshake_timeout: Duration§preserve_metadata: boolPreserve mtime and unix permission bits on received files.
Implementations§
Source§impl Config
impl Config
Sourcepub fn throughput() -> Self
pub fn throughput() -> Self
Saturate a fast link with large files: bigger chunks, cheap compression.
Sourcepub fn bandwidth_saving() -> Self
pub fn bandwidth_saving() -> Self
Minimise bytes on the wire for a slow or metered link.
pub fn with_chunk_size(self, n: usize) -> Self
pub fn with_streams(self, n: usize) -> Self
pub fn with_workers(self, n: usize) -> Self
pub fn with_secrecy(self, s: Secrecy) -> Self
pub fn with_compression(self, c: CompressionConfig) -> Self
pub fn without_compression(self) -> Self
Sourcepub fn memory_budget(&self) -> usize
pub fn memory_budget(&self) -> usize
Worst-case resident bytes for the chunk pipeline, excluding OS cache.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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<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