pub struct SftpOptions { /* private fields */ }
Expand description

Options when creating super::Sftp.

Implementations

Create a new SftpOptions.

Set flush_interval, default value is 0.5 ms.

flush_interval decides the maximum time your requests would stay in the write buffer before it is actually sent to the remote.

If another thread is doing flushing, then the internal flush_task super::Sftp started would wait for another flush_interval.

Setting it to be larger might improve overall performance by grouping writes and reducing the overhead of packet sent over network, but it might also increase latency, so be careful when setting the flush_interval.

If flush_interval is set to 0, then every packet is flushed immediately.

NOTE that it is perfectly OK to set flush_interval to 0 and it would not slowdown the program, as flushing is only performed on daemon.

Set max_pending_requests.

If the pending_requests is larger than max_pending_requests, then the flush task will flush the write buffer without waiting for flush_interval.

It is set to 100 by default.

Set the init buffer size for requests. It is used to store bytes::Bytes and it will be resized to fit the pending requests.

NOTE that sftp uses double buffer for efficient flushing without blocking the writers.

It is set to 100 by default.

Set the init buffer size for responses. If the header of the response is larger than the buffer, then the buffer will be resized to fit the size of the header.

It is set to 1024 by default.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.