BlockModule

Trait BlockModule 

Source
pub trait BlockModule:
    Exhaust
    + Debug
    + Display
    + Eq
    + Hash
    + Clone {
    // Required method
    fn namespace() -> &'static str;
}
Expand description

Types whose values identify blocks in a set of related blocks, which may be stored in a BlockProvider or under specific names in a Universe.

The names of the Universe’s corresponding BlockDefs are formed by combining the namespace() and self.to_string() (the Display trait implementation).

Implement this trait for an enum, then use the functions of BlockProvider to work with the described set of blocks.

TODO: consider replacing Display with a separate method so as not to presume its meaning

Required Methods§

Source

fn namespace() -> &'static str

A namespace for the members of this module; currently, this should be a /-separated path with no trailing slash, but (TODO:) we should have a more rigorous namespace scheme for Names in future versions.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§