pokerkit 1.1.0

Core type aliases, traits, and constants for robopoker
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Typed lattice index.

/// Opaque index into a [`crate::Lattice`]. Constructed only by the crate;
/// callers receive these from [`crate::Lattice::bracket`] or
/// `Translation::resolve` and pattern-match.
#[derive(Debug, Clone, Copy, Eq, Hash, PartialEq)]
pub struct Anchor(usize);

impl Anchor {
    pub const fn new(idx: usize) -> Self {
        Self(idx)
    }

    /// Index into the originating lattice.
    pub const fn idx(&self) -> usize {
        self.0
    }
}