Skip to main content

AskIterator

Trait AskIterator 

Source
pub trait AskIterator: Iterator + Sized {
    // Provided methods
    fn ask<S: Serialize + ?Sized>(self, state: &S) -> AskFuture<Vec<Self::Item>> ⓘ
       where Self::Item: QuestionSet { ... }
    fn ask_with_receipt<S: Serialize + ?Sized>(
        self,
        state: &S,
    ) -> AskWithReceiptFuture<Vec<Self::Item>> ⓘ
       where Self::Item: QuestionSet { ... }
}
Expand description

The ask of an iterator of question sets.

An iterator is not a QuestionSet, so this trait asks its sets as a Vec. To put an iterator in another set, collect it into a Vec.

Provided Methods§

Source

fn ask<S: Serialize + ?Sized>(self, state: &S) -> AskFuture<Vec<Self::Item>> ⓘ
where Self::Item: QuestionSet,

Asks each set of the iterator in one request, with the global client.

§Errors

The future returns an AskError as Ask::ask does.

§Panics

The future panics if it sends a request outside a Tokio runtime.

Source

fn ask_with_receipt<S: Serialize + ?Sized>( self, state: &S, ) -> AskWithReceiptFuture<Vec<Self::Item>> ⓘ
where Self::Item: QuestionSet,

Asks each set of the iterator, and returns a Receipt next to the answers.

§Errors

The future returns an AskError as Ask::ask does.

§Panics

The future panics if it sends a request outside a Tokio runtime.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§