pub trait Generator: Send + Sync {
type Item;
// Required method
fn generate<'life0, 'life1, 'async_trait>(
&'life0 self,
input: &'life1 str,
) -> Pin<Box<dyn Future<Output = Vec<Self::Item>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Generator is a kind of Source but it takes input. It is not envisaged that Generator will return a large number of items.
Generator can be used to implement a calculator (that needs a user input).