Skip to main content

model_feed

Function model_feed 

Source
pub fn model_feed<I, O, S, F, Fut>(
    items: S,
    route: F,
) -> Pin<Box<dyn Stream<Item = Result<Value, CratestackError>> + Send>>
where O: Serialize + Send + 'static, I: Send + 'static, S: Stream<Item = Result<I, CratestackError>> + Send + 'static, F: FnMut(I) -> Fut + Send + 'static, Fut: Future<Output = Result<Option<O>, CratestackError>> + Send + 'static,
Expand description

items routed by route and encoded to JSON values, ending with the error that stopped it (module docs). route returns what to send for an item, or nothing to drop it.