use core::num::NonZeroUsize;
use super::ResourceOwnerId;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct ResourceTableSnapshot {
owner: ResourceOwnerId,
capacity: NonZeroUsize,
active: usize,
vacant: usize,
exhausted: usize,
}
impl ResourceTableSnapshot {
pub(super) const fn new(
owner: ResourceOwnerId,
capacity: NonZeroUsize,
active: usize,
vacant: usize,
exhausted: usize,
) -> Self {
Self {
owner,
capacity,
active,
vacant,
exhausted,
}
}
pub const fn owner(self) -> ResourceOwnerId {
self.owner
}
pub const fn capacity(self) -> NonZeroUsize {
self.capacity
}
pub const fn active(self) -> usize {
self.active
}
pub const fn vacant(self) -> usize {
self.vacant
}
pub const fn exhausted(self) -> usize {
self.exhausted
}
}