Skip to main content

Kinds

Trait Kinds 

Source
pub trait Kinds {
    type Id: RefId;

    const NAMES: &'static [&'static str];

    // Provided method
    fn first() -> KindName { ... }
}
Expand description

One kind or several ((File, Doc), sharing an id type): what a reference field takes.

Required Associated Constants§

Source

const NAMES: &'static [&'static str]

Every kind’s name, the first the one written.

Required Associated Types§

Source

type Id: RefId

Their ids’ type, the same for every kind.

Provided Methods§

Source

fn first() -> KindName

The first of them: what a reference this reads is written as.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<A: Kind, B: Kind<Id = A::Id>, C: Kind<Id = A::Id>> Kinds for (A, B, C)

Source§

const NAMES: &'static [&'static str]

Source§

type Id = <A as Kind>::Id

Source§

impl<A: Kind, B: Kind<Id = A::Id>> Kinds for (A, B)

Source§

const NAMES: &'static [&'static str]

Source§

type Id = <A as Kind>::Id

Implementors§

Source§

impl<K: Kind> Kinds for K

Source§

const NAMES: &'static [&'static str]

Source§

type Id = <K as Kind>::Id