[][src]Trait monstermaker_core::Id

pub trait Id {
    fn id(&self) -> u16;
}

An identified type.

A type can implement this trait to provide an id, possibly defined interally in the type. For example:

use monstermaker_core::Id;

struct Foo {
    id: u16,
}

impl Id for Foo {
    fn id(&self) -> u16 {
        self.id
    }
}

Required methods

fn id(&self) -> u16

Returns the object's id.

Loading content...

Implementors

Loading content...