Trait gate::asset_id::IdU16[][src]

pub trait IdU16: Sized {
    fn id_u16(self) -> u16;
fn count() -> u16;
fn from_u16(id: u16) -> Option<Self>; }

A value that can be converted to a u16 ID, implemented by asset enums.

Required Methods

Converts self to a u16 ID.

This will be value between 0 (inclusive) and Self::count() (exclusive).

Returns the number of IDs in this enum.

Converts a u16 ID to the asset enum value, or None if id >= Self::count()

Implementors