Skip to main content

Completion

Struct Completion 

Source
pub struct Completion { /* private fields */ }
Expand description

The answer to a batch of reads, which can be waited on or polled.

Two ways to consume one and they are for different callers. Completion::wait is for the caller that needs all of it before it can do anything, which is most of them and is what read_at is written in terms of. Completion::take hands back reads in the order they finished, which is for the scan that decodes a page as soon as that page has arrived instead of waiting for the slowest read in the row group.

Implementations§

Source§

impl Completion

Source

pub fn pending(count: usize) -> (Self, Filler)

A completion for count requests, and the handle a backend fills it through.

Source

pub fn ready(responses: Vec<Result<Response>>) -> Self

A completion that is already finished, for a backend with nothing to wait for.

Source

pub fn len(&self) -> usize

How many requests were submitted.

Source

pub fn is_empty(&self) -> bool

Whether nothing was submitted.

Source

pub fn ready_count(&self) -> usize

How many reads have finished and not been taken, without blocking.

This is the poll. A scan uses it to decide whether there is decoding to be getting on with or whether it may as well wait.

Source

pub fn is_done(&self) -> bool

Whether every read has finished, without blocking.

Source

pub fn take(&mut self) -> Option<Result<Response>>

The next read to finish, blocking until one does.

None once every request has been handed back. The order is completion order, which is why Response::index exists.

Source

pub fn wait(self) -> Result<Vec<Response>>

Every response that has not already been taken, in the order the requests were submitted.

Blocks until the last read finishes.

§Errors

The first failure by request position, so that two runs of the same faulty read report the same error rather than whichever one happened to finish first.

Trait Implementations§

Source§

impl Debug for Completion

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.