pub struct Generator<'a, Input: 'a, Output: 'a, Stack: Stack> { /* private fields */ }Expand description
Generator wraps a closure and allows suspending its execution more than once, returning a value each time.
If the closure finishes each other call to resume
will yield None. If the closure panics the unwind will happen correctly across contexts.
Implementations§
Source§impl<'a, Input, Output, Stack> Generator<'a, Input, Output, Stack>where
Input: 'a,
Output: 'a,
Stack: Stack,
impl<'a, Input, Output, Stack> Generator<'a, Input, Output, Stack>where
Input: 'a,
Output: 'a,
Stack: Stack,
Trait Implementations§
Source§impl<'a, Input, Output, Stack> Drop for Generator<'a, Input, Output, Stack>where
Input: 'a,
Output: 'a,
Stack: Stack,
impl<'a, Input, Output, Stack> Drop for Generator<'a, Input, Output, Stack>where
Input: 'a,
Output: 'a,
Stack: Stack,
impl<'a, Input, Output, Stack> Send for Generator<'a, Input, Output, Stack>where
Input: 'a,
Output: 'a,
Stack: Stack,
Auto Trait Implementations§
impl<'a, Input, Output, Stack> Freeze for Generator<'a, Input, Output, Stack>where
Stack: Freeze,
impl<'a, Input, Output, Stack> RefUnwindSafe for Generator<'a, Input, Output, Stack>
impl<'a, Input, Output, Stack> !Sync for Generator<'a, Input, Output, Stack>
impl<'a, Input, Output, Stack> Unpin for Generator<'a, Input, Output, Stack>where
Stack: Unpin,
impl<'a, Input, Output, Stack> UnwindSafe for Generator<'a, Input, Output, Stack>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more