pub struct SharedData<Buffer, Auxiliary = ()>(_);
Expand description

SharedData contains both the writer and the responses because:

  • The overhead of Arc and a separate allocation;
  • If the write end of a connection is closed, then openssh implementation of sftp-server would close the read end right away, discarding any unsent but processed or unprocessed responses.

Implementations

SharedData is a newtype wrapper for Arc<SharedDataInner>, so this function returns how many Arc there are that referred to the shared data.

Create a useable response id.

Return true if reserve succeeds, false otherwise.

Return true if reserve succeeds, false otherwise.

Flush the write buffer.

If another thread is flushing, then Ok(false) will be returned.

Cancel Safety

This function is only cancel safe if WriteEnd::send_write_request_direct or WriteEnd::send_write_request_direct_vectored is not called when this future is cancelled.

Upon cancel, it might only partially flushed out the data, which can be restarted by another thread.

However, if WriteEnd::send_write_request_direct or WriteEnd::send_write_request_direct_vectored is called, then the write data will be interleaved and thus produce undefined behavior.

Flush the write buffer.

If another thread is flushing, then this function would wait until the other thread is done.

Cancel Safety

This function is only cancel safe if WriteEnd::send_write_request_direct or WriteEnd::send_write_request_direct_vectored is not called when this future is cancelled.

Upon cancel, it might only partially flushed out the data, which can be restarted by another thread.

However, if WriteEnd::send_write_request_direct or WriteEnd::send_write_request_direct_vectored is called, then the write data will be interleaved and thus produce undefined behavior.

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

Executes the destructor for this 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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.