use core::num::NonZeroUsize;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct TransportBudget {
operations: NonZeroUsize,
read_bytes: NonZeroUsize,
write_bytes: NonZeroUsize,
}
impl TransportBudget {
pub const fn new(
operations: NonZeroUsize,
read_bytes: NonZeroUsize,
write_bytes: NonZeroUsize,
) -> Self {
Self {
operations,
read_bytes,
write_bytes,
}
}
pub const fn operations(self) -> NonZeroUsize {
self.operations
}
pub const fn read_bytes(self) -> NonZeroUsize {
self.read_bytes
}
pub const fn write_bytes(self) -> NonZeroUsize {
self.write_bytes
}
}