pub trait Writer: AsyncWrite + Unpin {
    const MAX_ATOMIC_WRITE_LEN: usize;

    fn poll_write_vectored_atomic(
        &self,
        cx: &mut Context<'_>,
        bufs: &[IoSlice<'_>]
    ) -> Poll<Result<()>>; fn poll_flush_buffers(
        &mut self,
        cx: &mut Context<'_>,
        buffers: &mut Buffers<'_>
    ) -> Poll<Result<()>> { ... }
fn io_slices_buffer_len() -> NonZeroUsize { ... } }
Expand description

trait for Writer that can be used as output for sftp client.

Associated Constants

The maximum length of which poll_write_vectored_atomic can accept.

Required methods

Return 0 if and only if the the bufs cannot be written atomically.

For write zero error, use io::ErrorKind::WriteZero.

The write is atomic, either if fails, or it writes all bufs at once.

Provided methods

Flush the buffers.

It is cancellable and can be restarted with another thread.

Return the length of IoSlice buffer.

Return 0 if your poll_flush_buffers is completely zero-copy by using Buffers::drain_bytes API.

Implementors