use std::fmt;
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct AtomIndex(usize);
impl AtomIndex {
#[must_use]
pub const fn new(index: usize) -> Self {
Self(index)
}
#[must_use]
pub const fn get(self) -> usize {
self.0
}
}
impl From<usize> for AtomIndex {
fn from(value: usize) -> Self {
Self::new(value)
}
}
impl fmt::Display for AtomIndex {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(formatter, "{}", self.0)
}
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct AtomCount(usize);
impl AtomCount {
#[must_use]
pub const fn new(count: usize) -> Self {
Self(count)
}
#[must_use]
pub const fn get(self) -> usize {
self.0
}
#[must_use]
pub const fn is_zero(self) -> bool {
self.0 == 0
}
}
impl From<usize> for AtomCount {
fn from(value: usize) -> Self {
Self::new(value)
}
}
impl fmt::Display for AtomCount {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(formatter, "{}", self.0)
}
}