pub struct FileTransferConfig {
pub chunk_size: usize,
pub max_file_size: u64,
pub max_concurrent_assemblies: usize,
pub max_assemblies_per_sender: usize,
pub max_total_buffered_bytes: u64,
}Expand description
File transfer configuration.
Fields§
§chunk_size: usizeSize of each chunk in bytes. Chunk sizes that would split a file
into more chunks than the receive-side cap derived from
max_file_size (one chunk per KiB of max_file_size, minimum 1024)
are rejected by FileTransferManager::chunk_file — a receiver
with the same configuration would drop every chunk of such a
transfer.
max_file_size: u64Maximum file size allowed (bytes).
max_concurrent_assemblies: usizeMaximum number of inbound files that may be reassembling at once. Chunks that would start an additional assembly are rejected; slots free when a transfer completes, is cancelled, or goes stale.
max_assemblies_per_sender: usizeMaximum number of inbound files a single sender may have reassembling at once, so one peer cannot occupy every assembly slot. Only as strong as sender authentication: MLS-path senders are cryptographically bound, but legacy plaintext senders are wire claims a peer can rotate — there, this quota bounds only honest peers, and the global count and byte caps are the real limits.
max_total_buffered_bytes: u64Maximum total bytes buffered across all inbound assemblies. This —
not the assembly counts — is the hard bound on receive-path memory.
Each stored chunk is charged its payload plus a small fixed
bookkeeping overhead, so floods of tiny chunks cannot pin more
memory than the budget admits. Values below what a single
max_file_size transfer charges are clamped up to it by
FileTransferManager::with_config, or a maximum-size file could
never complete.
Trait Implementations§
Source§impl Clone for FileTransferConfig
impl Clone for FileTransferConfig
Source§fn clone(&self) -> FileTransferConfig
fn clone(&self) -> FileTransferConfig
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 FileTransferConfig
impl Debug for FileTransferConfig
Auto Trait Implementations§
impl Freeze for FileTransferConfig
impl RefUnwindSafe for FileTransferConfig
impl Send for FileTransferConfig
impl Sync for FileTransferConfig
impl Unpin for FileTransferConfig
impl UnsafeUnpin for FileTransferConfig
impl UnwindSafe for FileTransferConfig
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> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
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