Trait Id

Source
pub trait Id<K>
where K: Identifier,
{ type Q: Borrow<K>; // Required methods fn from_id(id: Self::Q) -> Self; fn get(&self) -> &Self::Q; }
Expand description

The Id trait describes the behavior of a type that can be used as an id. An Id is almost identical to an Identifier, but it is a trait that can be implemented for any type.

Required Associated Types§

Source

type Q: Borrow<K>

Required Methods§

Source

fn from_id(id: Self::Q) -> Self

Source

fn get(&self) -> &Self::Q

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<K, Q> Id<K> for Q
where K: Identifier, Q: Borrow<K>,

Source§

type Q = Q