Derive Macro runestick::Any[][src]

#[derive(Any)]
{
    // Attributes available to this derive:
    #[rune]
}
Expand description

Macro to mark a value as external, which will implement all the appropriate traits.

This is required to support the external type as a type argument in a registered function.

#[rune(name = "..")] attribute

The name of a type defaults to its identifiers, so struct Foo {} would be given the name "Foo".

This can be overrided with the #[rune(name = "...")] attribute:

use runestick::Any;

#[derive(Any)]
#[rune(name = "Bar")]
struct Foo {
}

fn install() -> Result<runestick::Module, runestick::ContextError> {
    let mut module = runestick::Module::new();
    module.ty::<Foo>()?;
    Ok(module)
}