pub struct RequestCollection<'a, D: ?Sized> { /* private fields */ }
Expand description

Request collection for managing multiple requests at the same time.

Implementations§

source§

impl<'a, D: ?Sized> RequestCollection<'a, D>

source

pub fn incomplete(&self) -> usize

Return the total number of requests that are incomplete.

source

pub fn add<S>(&mut self, req: Request<'a, D, S>) -> usize
where S: Scope<'a>,

Add the request to the collection. This unregisters the request from the scope. The collection then ensures that the request has completed.

source

pub fn wait_any(&mut self) -> Option<(usize, Status, &'a D)>

Wait for any request to complete, and return an option containing (request_index, status, saved_data).

source

pub fn wait_some(&mut self, result: &mut Vec<(usize, Status, &'a D)>)

Wait for some of the requests to complete, fill result with references to the (request_index, status, saved_data) for each completed request and return the total number of completed requests.

source

pub fn wait_all(&mut self, result: &mut Vec<(usize, Status, &'a D)>)

Wait for all requests to complete, putting (request_index, status, saved_data) into result for every completed request.

source

pub fn test_any(&mut self) -> Option<(usize, Status, &'a D)>

Test for the completion of any requests. Returns an option containing (request_index, status, saved_data).

source

pub fn test_some(&mut self, result: &mut Vec<(usize, Status, &'a D)>)

Test for the completion of some requests. Completed request data will be stored in the result buffer in a tuple (request_index, status, saved_data).

source

pub fn test_all(&mut self, result: &mut Vec<(usize, Status, &'a D)>) -> bool

Test for the completion of all requests. Saved data used by the completed requests is stored in the result buffer.

Trait Implementations§

source§

impl<'a, D: ?Sized> Drop for RequestCollection<'a, D>

Drop implementation to ensure that all requests have actually completed.

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a, D: ?Sized> RefUnwindSafe for RequestCollection<'a, D>
where D: RefUnwindSafe,

§

impl<'a, D> !Send for RequestCollection<'a, D>

§

impl<'a, D> !Sync for RequestCollection<'a, D>

§

impl<'a, D: ?Sized> Unpin for RequestCollection<'a, D>

§

impl<'a, D: ?Sized> UnwindSafe for RequestCollection<'a, D>
where D: RefUnwindSafe,

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<Src, Scheme> ApproxFrom<Src, Scheme> for Src
where Scheme: ApproxScheme,

§

type Err = NoError

The error type produced by a failed conversion.
source§

fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>

Convert the given value into an approximately equivalent representation.
source§

impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src
where Dst: ApproxFrom<Src, Scheme>, Scheme: ApproxScheme,

§

type Err = <Dst as ApproxFrom<Src, Scheme>>::Err

The error type produced by a failed conversion.
source§

fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>

Convert the subject into an approximately equivalent representation.
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, Dst> ConvAsUtil<Dst> for T

source§

fn approx(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject with the default scheme.
source§

fn approx_by<Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject with a specific scheme.
source§

impl<T> ConvUtil for T

source§

fn approx_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject to a given type with the default scheme.
source§

fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject to a given type with a specific scheme.
source§

fn into_as<Dst>(self) -> Dst
where Self: Sized + Into<Dst>,

Convert the subject to a given type.
source§

fn try_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + TryInto<Dst>,

Attempt to convert the subject to a given type.
source§

fn value_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ValueInto<Dst>,

Attempt a value conversion of the subject to a given type.
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<Src> TryFrom<Src> for Src

§

type Err = NoError

The error type produced by a failed conversion.
source§

fn try_from(src: Src) -> Result<Src, <Src as TryFrom<Src>>::Err>

Convert the given value into the subject type.
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<Src, Dst> TryInto<Dst> for Src
where Dst: TryFrom<Src>,

§

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.
source§

fn try_into(self) -> Result<Dst, <Src as TryInto<Dst>>::Err>

Convert the subject into the destination type.
source§

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

§

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.
source§

impl<Src> ValueFrom<Src> for Src

§

type Err = NoError

The error type produced by a failed conversion.
source§

fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>

Convert the given value into an exactly equivalent representation.
source§

impl<Src, Dst> ValueInto<Dst> for Src
where Dst: ValueFrom<Src>,

§

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.
source§

fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>

Convert the subject into an exactly equivalent representation.