Skip to main content
pub struct KifsFileHandlerOptions  /* private fields */ 

Options for the KiFS file handler.

These options control the behavior of file uploads and downloads, including batch sizes and upload concurrency.

The fields are private and are set only through the validating with_* methods. A public file_size_to_split could be set to 0 or a negative number, which the multi-part part-count arithmetic divides by.

Example

Implementations

Source

pub fn new() -> Self

Creates a new KifsFileHandlerOptions with default values.

Sets the file size threshold for multi-part transfers.

  • size - Size in bytes. Must be a positive value <= 60 MB.

Fails if the size is <= 0 or > 60 MB.

Sets how many full-file upload batches are sent concurrently.

Uploads proceed in waves: up to this many batches are sent at once, and the next wave starts when every batch of the current one has finished.

  • size - Number of concurrent batches. Must be between 1 and the number of available CPUs.

Fails if the size is 0 or greater than the number of available CPUs.

Sets the ceiling on full-file upload payload bytes held in memory at once.

Lower it where memory is tight: an upload then waits for outstanding batches to finish more often, trading throughput for a smaller peak. Raise it for more throughput where memory is plentiful.

  • bytes - The ceiling in bytes. Must be positive.

Fails if bytes is <= 0.

Source

pub fn with_termination_timeout(self, timeout: u64) -> Self

Sets the timeout for thread pool termination.

This has no effect. There are no thread pools to shut down: the upload tasks are awaited to completion, and aborted as soon as the operation’s future is dropped.

  • timeout - Timeout in seconds.

Returns the file size threshold for multi-part transfers.

Returns the number of full-file upload batches sent concurrently.

Returns the number of full-file upload batches sent concurrently.

Returns the ceiling on full-file upload payload bytes held in memory at once.

Returns the termination timeout.

Trait Implementations

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

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

Formats the value using the given formatter. Read more
Source

fn default() -> Self

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