Skip to main content

IdKind

Trait IdKind 

Source
pub trait IdKind:
    Copy
    + Ord
    + Hash {
    const MNEMONIC: char;
    const NOUN: &'static str;

    // Required method
    fn mark(ids: &mut Allocator) -> &mut u32;
}
Expand description

The supertraits are the tag’s, not the id’s: Id<K> derives Copy, Ord and Hash, and without them every generic bound would have to restate what a compile-time tag trivially satisfies.

Required Associated Constants§

Source

const MNEMONIC: char

The lower-case letter every id of this kind is spelled with.

Source

const NOUN: &'static str

What this kind is called in a message a human reads.

Required Methods§

Source

fn mark(ids: &mut Allocator) -> &mut u32

This kind’s high-water mark inside an Allocator.

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§

Source§

impl IdKind for AreaKind

Source§

const MNEMONIC: char = 'a'

Source§

const NOUN: &'static str = "area"

Source§

impl IdKind for BlockKind

Source§

const MNEMONIC: char = 'b'

Source§

const NOUN: &'static str = "block"

Source§

impl IdKind for ImageKind

Source§

const MNEMONIC: char = 'i'

Source§

const NOUN: &'static str = "image"

Source§

impl IdKind for PinKind

Source§

const MNEMONIC: char = 'p'

Source§

const NOUN: &'static str = "pin"

Source§

impl IdKind for RouteKind

Source§

const MNEMONIC: char = 'r'

Source§

const NOUN: &'static str = "route"

Source§

impl IdKind for RouteLabelKind

Source§

const MNEMONIC: char = 'x'

Source§

const NOUN: &'static str = "route-label"

Source§

impl IdKind for TextKind

Source§

const MNEMONIC: char = 't'

Source§

const NOUN: &'static str = "text"