use std::num::NonZero;
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
pub struct SubscriptionId(NonZero<usize>);
impl SubscriptionId {
pub(super) fn new(id: usize) -> Option<Self> {
Some(SubscriptionId(NonZero::new(id)?))
}
#[expect(clippy::inherent_to_string)] pub(super) fn to_string(self) -> String {
self.0.to_string()
}
pub(super) fn from_str(s: &str) -> Option<Self> {
SubscriptionId::new(s.parse::<usize>().ok()?)
}
}