pub fn option<N>(&mut self, name: N) -> Result<(), ContextError>
    where
        N: IntoIterator,
        N::Item: IntoComponent,
    {
        let mut enum_ = ModuleInternalEnum::new("Option", name, crate::OPTION_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("Some", TypeCheck::Option(0), Option::<Value>::Some);
        enum_.variant("None", TypeCheck::Option(1), || Option::<Value>::None);
        self.internal_enums.push(enum_);
        Ok(())
    }
/// Construct type information for the `Option` type.
///
/// Registering this allows the given type to be used in Rune scripts when
/// referring to the `Option` type.
///
/// # Examples
///
/// This shows how to register the `Option` as `nonstd::option::Option`.
///
/// ```rust
/// use runestick::Module;
///
/// # fn main() -> runestick::Result<()> {
/// let mut module = Module::with_crate_item("nonstd", &["option"]);
/// module.result(&["Option"])?;
/// # Ok(()) }
Construct type information for the `Option` type.
Registering this allows the given type to be used in Rune scripts when
referring to the `Option` type.
Construct type information for the ` Option ` type . Registering this allows the given type to be used in Rune scripts when referring to the ` Option ` type .
pub fn option<N>(&mut self, name: N) -> Result<(), ContextError>
    where
        N: IntoIterator,
        N::Item: IntoComponent,
    {
        let mut enum_ = ModuleInternalEnum::new("Option", name, crate::OPTION_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("Some", TypeCheck::Option(0), Option::<Value>::Some);
        enum_.variant("None", TypeCheck::Option(1), || Option::<Value>::None);
        self.internal_enums.push(enum_);
        Ok(())
    }
pub fn option < N > ( & mut self , name : N ) -> Result < ( ) , ContextError > where N : IntoIterator , N :: Item : IntoComponent , { let mut enum_ = ModuleInternalEnum :: new ( " " , name , crate :: OPTION_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 :: Option ( 0 ) , Option :: < Value > :: Some ) ; enum_ . variant ( " " , TypeCheck :: Option ( 1 ) , | | Option :: < Value > :: None ) ; self . internal_enums . push ( enum_ ) ; Ok ( ( ) ) }
Construct type information for the `Option` type.
Construct type information for the ` Option ` type .
&mut self
name
N
&mut self
name
N
examples
This shows how to register the `Option` as `nonstd::option::Option`.

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