Skip to main content

HasId

Trait HasId 

Source
pub trait HasId {
    // Required method
    fn id(&self) -> Uuid;
}
Expand description

Trait for candidates with stable UUID identifiers.

Implementing this trait enables deterministic tie-breaking when candidates have equal scores.

§Contract

  • id() MUST return the same value for the same logical entity
  • The UUID SHOULD be globally unique (use Uuid::new_v4() or similar)
  • The UUID MUST NOT change between calls for the same instance

Required Methods§

Source

fn id(&self) -> Uuid

Returns the stable UUID identifier for this candidate.

Implementations on Foreign Types§

Source§

impl HasId for (f32, Uuid)

Source§

fn id(&self) -> Uuid

Source§

impl HasId for (f64, Uuid)

Source§

fn id(&self) -> Uuid

Source§

impl HasId for Uuid

Source§

fn id(&self) -> Uuid

Source§

impl<T: HasId> HasId for &T

Source§

fn id(&self) -> Uuid

Source§

impl<T: HasId> HasId for &mut T

Source§

fn id(&self) -> Uuid

Source§

impl<T: HasId> HasId for Box<T>

Source§

fn id(&self) -> Uuid

Source§

impl<T: HasId> HasId for Arc<T>

Source§

fn id(&self) -> Uuid

Implementors§