Trait runestick::Any[][src]

pub trait Any: Named + Any {
    fn type_hash() -> Hash;
}

A trait which can be stored inside of an AnyObj.

We use our own marker trait that must be explicitly derived to prevent other VM native types (like strings) which also implement std::any::Any from being stored as an AnyObj.

This means, that only types which derive Any can be used inside of the VM:

use runestick::Any;

#[derive(Any)]
struct Npc {
    name: String,
}

Required methods

fn type_hash() -> Hash[src]

The type hash of the type.

TODO: make const field when TypeId::of is const.

Loading content...

Implementations on Foreign Types

impl Any for Error[src]

impl Any for Error[src]

impl Any for Error[src]

impl Any for Ordering[src]

impl Any for ParseCharError[src]

impl Any for ParseFloatError[src]

impl Any for ParseIntError[src]

Loading content...

Implementors

Loading content...