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
impl Completion
Sourcepub fn pending(count: usize) -> (Self, Filler)
pub fn pending(count: usize) -> (Self, Filler)
A completion for count requests, and the handle a backend fills it through.
Sourcepub fn ready(responses: Vec<Result<Response>>) -> Self
pub fn ready(responses: Vec<Result<Response>>) -> Self
A completion that is already finished, for a backend with nothing to wait for.
Sourcepub fn ready_count(&self) -> usize
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.
Sourcepub fn take(&mut self) -> Option<Result<Response>>
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.
Sourcepub fn wait(self) -> Result<Vec<Response>>
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.