pub enum PartialOp {
    Limited(usize),
    Unlimited,
    Err(ErrorKind),
}
Expand description

What to do the next time an IO operation is performed.

This is not the same as io::Result<Option<usize>> because it contains io::ErrorKind instances, not io::Error instances. This allows it to be clonable.

Variants

Limited(usize)

Limit the next IO operation to a certain number of bytes.

The wrapper will call into the inner Read or Write instance. Depending on what the underlying operation does, this may return an error or a fewer number of bytes.

Some methods like Write::flush and AsyncWrite::poll_flush don’t have a limit. For these methods, Limited(n) behaves the same as Unlimited.

Unlimited

Do not limit the next IO operation.

The wrapper will call into the inner Read or Write instance. Depending on what the underlying operation does, this may return an error or a limited number of bytes.

Err(ErrorKind)

Return an error instead of calling into the underlying operation.

For methods on Async traits:

  • ErrorKind::WouldBlock is translated to Poll::Pending and the task is scheduled to be woken up in the future.
  • ErrorKind::Interrupted causes a retry.

Trait Implementations

Return an arbitrary value. Read more

Return an iterator of values that are smaller than itself. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. 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.