Skip to main content

fallible_repeat

Function fallible_repeat 

Source
pub fn fallible_repeat<'a, L, E>(elt: FallibleLend<'a, L>) -> Repeat<'a, L, E>
where L: ?Sized + CovariantFallibleLending + 'a, for<'all> FallibleLend<'all, L>: Clone,
Expand description

Creates a new fallible lender that endlessly repeats a single element.

This is the FallibleLender version of iter::repeat().

To create a lender that endlessly repeats an error, use repeat_err().

ยงExamples

let mut lender = lender::fallible_repeat::<
    '_, fallible_lend!(&'lend i32), String,
>(&0);
assert_eq!(lender.next().unwrap(), Some(&0));