pub fn generator_state<N>(&mut self, name: N) -> Result<(), ContextError>
    where
        N: IntoIterator,
        N::Item: IntoComponent,
    {
        let mut enum_ =
            ModuleInternalEnum::new("GeneratorState", name, crate::GENERATOR_STATE_TYPE);

        // Note: these numeric variants are magic, and must simply match up with
        // what's being used in the virtual machine implementation for these
        // types.
        enum_.variant(
            "Complete",
            TypeCheck::GeneratorState(0),
            GeneratorState::Complete,
        );
        enum_.variant(
            "Yielded",
            TypeCheck::GeneratorState(1),
            GeneratorState::Yielded,
        );

        self.internal_enums.push(enum_);
        Ok(())
    }
/// Construct the type information for the `GeneratorState` type.
///
/// Registering this allows the given type to be used in Rune scripts when
/// referring to the `GeneratorState` type.
///
/// # Examples
///
/// This shows how to register the `GeneratorState` as
/// `nonstd::generator::GeneratorState`.
///
/// ```rust
/// use runestick::Module;
///
/// # fn main() -> runestick::Result<()> {
/// let mut module = Module::with_crate_item("nonstd", &["generator"]);
/// module.generator_state(&["GeneratorState"])?;
/// # Ok(()) }
Construct the type information for the `GeneratorState` type.
Registering this allows the given type to be used in Rune scripts when
referring to the `GeneratorState` type.
Construct the type information for the ` GeneratorState ` type . Registering this allows the given type to be used in Rune scripts when referring to the ` GeneratorState ` type .
pub fn generator_state<N>(&mut self, name: N) -> Result<(), ContextError>
    where
        N: IntoIterator,
        N::Item: IntoComponent,
    {
        let mut enum_ =
            ModuleInternalEnum::new("GeneratorState", name, crate::GENERATOR_STATE_TYPE);
        // Note: these numeric variants are magic, and must simply match up with
        // what's being used in the virtual machine implementation for these
        // types.
        enum_.variant(
            "Complete",
            TypeCheck::GeneratorState(0),
            GeneratorState::Complete,
        );
        enum_.variant(
            "Yielded",
            TypeCheck::GeneratorState(1),
            GeneratorState::Yielded,
        );
        self.internal_enums.push(enum_);
        Ok(())
    }
pub fn generator_state < N > ( & mut self , name : N ) -> Result < ( ) , ContextError > where N : IntoIterator , N :: Item : IntoComponent , { let mut enum_ = ModuleInternalEnum :: new ( " " , name , crate :: GENERATOR_STATE_TYPE ) ; // Note: these numeric variants are magic, and must simply match up with // what's being used in the virtual machine implementation for these // types. enum_ . variant ( " " , TypeCheck :: GeneratorState ( 0 ) , GeneratorState :: Complete , ) ; enum_ . variant ( " " , TypeCheck :: GeneratorState ( 1 ) , GeneratorState :: Yielded , ) ; self . internal_enums . push ( enum_ ) ; Ok ( ( ) ) }
Construct the type information for the `GeneratorState` type.
Construct the type information for the ` GeneratorState ` type .
&mut self
name
N
&mut self
name
N
examples
This shows how to register the `GeneratorState` as
`nonstd::generator::GeneratorState`.

```rust
use runestick::Module.
This shows how to register the ` GeneratorState ` as ` nonstd :: generator :: GeneratorState ` . ` ` ` rust use runestick :: Module .
fn main() -> runestick::result<()> {
let mut module = Module::with_crate_item("nonstd", &["generator"]);
module.generator_state(&["GeneratorState"])?.
let mut module = Module :: with_crate_item ( " nonstd " & [ " generator " ] ) ; module . generator_state ( & [ " GeneratorState " ] ) ? .
ok(()) }
None