Skip to main content

Id

Trait Id 

Source
pub trait Id {
    type Id: Hash + Eq + Clone + Debug + Send + Serialize + for<'a> Deserialize<'a>;

    // Required method
    fn id(&self) -> &Self::Id;
}
Expand description

Trait for an object that can provide an Id for itself.

Required Associated Types§

Source

type Id: Hash + Eq + Clone + Debug + Send + Serialize + for<'a> Deserialize<'a>

Type of the id value.

Required Methods§

Source

fn id(&self) -> &Self::Id

Returns a reference to the current id.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl Id for EmptyStat

Source§

impl<I, V> Id for SimpleAbility<I, V>
where I: Debug + Hash + Eq + Clone + Send + Serialize + for<'a> Deserialize<'a>,

Available on crate feature serialization only.
Source§

type Id = I

Source§

impl<I, V> Id for SimpleStatistic<I, V>
where I: Debug + Hash + Eq + Clone + Send + Serialize + for<'a> Deserialize<'a>,

Available on crate feature serialization only.
Source§

type Id = I

Source§

impl<I, V> Id for SimpleStatus<I, V>
where I: Debug + Hash + Eq + Clone + Send + Serialize + for<'a> Deserialize<'a>,

Available on crate feature serialization only.
Source§

type Id = I

Source§

impl<R: BattleRules> Id for Creature<R>

Source§

impl<R: BattleRules> Id for Object<R>

Source§

impl<R: BattleRules> Id for Team<R>

Source§

type Id = <<R as BattleRules>::TR as TeamRules<R>>::Id