pub struct Generator { /* private fields */ }Expand description
A generator with a stored virtual machine.
Implementations§
Source§impl Generator
impl Generator
Sourcepub fn next(&mut self) -> Result<Option<Value>, VmError>
pub fn next(&mut self) -> Result<Option<Value>, VmError>
Get the next value produced by this stream.
Sourcepub fn resume(&mut self, value: Value) -> Result<GeneratorState, VmError>
pub fn resume(&mut self, value: Value) -> Result<GeneratorState, VmError>
Get the next value produced by this stream.
Sourcepub fn into_iterator(self) -> Result<Iterator, VmError>
pub fn into_iterator(self) -> Result<Iterator, VmError>
Convert into iterator
Trait Implementations§
Source§impl InstallWith for Generator
impl InstallWith for Generator
Source§fn install_with(_: &mut Module) -> Result<(), ContextError>
fn install_with(_: &mut Module) -> Result<(), ContextError>
Hook to install more things into the module.
Source§impl IntoIterator for Generator
impl IntoIterator for Generator
Source§impl UnsafeFromValue for &Generator
impl UnsafeFromValue for &Generator
Source§impl UnsafeFromValue for &mut Generator
impl UnsafeFromValue for &mut Generator
Auto Trait Implementations§
impl Freeze for Generator
impl !RefUnwindSafe for Generator
impl !Send for Generator
impl !Sync for Generator
impl Unpin for Generator
impl !UnwindSafe for Generator
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
Source§impl<T> UnsafeFromValue for Twhere
T: FromValue,
impl<T> UnsafeFromValue for Twhere
T: FromValue,
Source§fn from_value(
value: Value,
) -> Result<(T, <T as UnsafeFromValue>::Guard), VmError>
fn from_value( value: Value, ) -> Result<(T, <T as UnsafeFromValue>::Guard), VmError>
Convert the given reference using unsafe assumptions to a value. Read more
Source§unsafe fn unsafe_coerce(output: <T as UnsafeFromValue>::Output) -> T
unsafe fn unsafe_coerce(output: <T as UnsafeFromValue>::Output) -> T
Coerce the output of an unsafe from value into the final output type. Read more