Lines Matching refs:ByteCountOutOfBounds
48 pub fn new_rounded_up(bytes: usize) -> Result<Self, ByteCountOutOfBounds> { in new_rounded_up() argument
53 None => Err(ByteCountOutOfBounds(ByteCountOutOfBoundsKind::RoundUp)), in new_rounded_up()
61 pub fn new_rounded_up_u64(bytes: u64) -> Result<Self, ByteCountOutOfBounds> { in new_rounded_up_u64() argument
64 .map_err(|_| ByteCountOutOfBounds(ByteCountOutOfBoundsKind::ConvertU64))?; in new_rounded_up_u64()
89 pub fn checked_add(self, bytes: HostAlignedByteCount) -> Result<Self, ByteCountOutOfBounds> { in checked_add() argument
94 .ok_or(ByteCountOutOfBounds(ByteCountOutOfBoundsKind::Add)) in checked_add()
103 pub fn checked_sub(self, bytes: HostAlignedByteCount) -> Result<Self, ByteCountOutOfBounds> { in checked_sub() argument
108 .ok_or_else(|| ByteCountOutOfBounds(ByteCountOutOfBoundsKind::Sub)) in checked_sub()
121 pub fn checked_mul(self, scalar: usize) -> Result<Self, ByteCountOutOfBounds> { in checked_mul() argument
126 .ok_or_else(|| ByteCountOutOfBounds(ByteCountOutOfBoundsKind::Mul)) in checked_mul()
133 pub fn checked_div(self, divisor: HostAlignedByteCount) -> Result<usize, ByteCountOutOfBounds> { in checked_div() argument
136 .ok_or_else(|| ByteCountOutOfBounds(ByteCountOutOfBoundsKind::Div)) in checked_div()
145 pub fn checked_rem(self, divisor: HostAlignedByteCount) -> Result<Self, ByteCountOutOfBounds> { in checked_rem() argument
159 .ok_or_else(|| ByteCountOutOfBounds(ByteCountOutOfBoundsKind::Rem)) in checked_rem()
239 pub struct ByteCountOutOfBounds(ByteCountOutOfBoundsKind); struct
241 impl fmt::Display for ByteCountOutOfBounds { implementation
247 impl core::error::Error for ByteCountOutOfBounds {} implementation