pub fn cache_until<T>(
iter: Box<dyn Iterator<Item = Result<T, Error>>>,
pred: fn(&T) -> Result<bool, Error>,
max_pred_execute_count: i128,
pred_append_tail: bool,
) -> Box<dyn Iterator<Item = Result<Vec<T>, Error>>>where
T: Clone + 'static,