Lines Matching refs:HostAlignedByteCount

9 pub struct HostAlignedByteCount(  struct
14 impl HostAlignedByteCount { impl
69 pub fn host_page_size() -> HostAlignedByteCount { in host_page_size()
71 HostAlignedByteCount(host_page_size()) in host_page_size()
89 pub fn checked_add(self, bytes: HostAlignedByteCount) -> Result<Self, ByteCountOutOfBounds> { in checked_add()
103 pub fn checked_sub(self, bytes: HostAlignedByteCount) -> Result<Self, ByteCountOutOfBounds> { in checked_sub()
113 pub fn saturating_sub(self, bytes: HostAlignedByteCount) -> Self { in saturating_sub()
133 pub fn checked_div(self, divisor: HostAlignedByteCount) -> Result<usize, ByteCountOutOfBounds> { in checked_div()
145 pub fn checked_rem(self, divisor: HostAlignedByteCount) -> Result<Self, ByteCountOutOfBounds> { in checked_rem()
173 impl PartialEq<usize> for HostAlignedByteCount { implementation
180 impl PartialEq<HostAlignedByteCount> for usize {
182 fn eq(&self, other: &HostAlignedByteCount) -> bool { in eq()
207 impl fmt::Display for HostAlignedByteCount { implementation
216 impl fmt::LowerHex for HostAlignedByteCount { implementation
286 impl Arbitrary for HostAlignedByteCount { implementation
304 .prop_map(|n| HostAlignedByteCount::new(n * host_page_size()).unwrap()) in arbitrary_with()
317 let byte_count = HostAlignedByteCount::new(65536).unwrap(); in byte_count_display()
327 HostAlignedByteCount::new(0).expect("0 is aligned"); in byte_count_ops()
328 HostAlignedByteCount::new(host_page_size).expect("host_page_size is aligned"); in byte_count_ops()
329 HostAlignedByteCount::new(host_page_size * 2).expect("host_page_size * 2 is aligned"); in byte_count_ops()
330 HostAlignedByteCount::new(host_page_size + 1) in byte_count_ops()
332 HostAlignedByteCount::new(host_page_size / 2) in byte_count_ops()
336 HostAlignedByteCount::new_rounded_up(usize::MAX).expect_err("usize::MAX overflows"); in byte_count_ops()
338 HostAlignedByteCount::new_rounded_up(usize::MAX - host_page_size) in byte_count_ops()
340 HostAlignedByteCount::new((usize::MAX - host_page_size) + 1) in byte_count_ops()
345 let half_max = HostAlignedByteCount::new((usize::MAX >> 1) + 1) in byte_count_ops()
348 .checked_add(HostAlignedByteCount::host_page_size()) in byte_count_ops()
356 .checked_sub(HostAlignedByteCount::host_page_size()) in byte_count_ops()
360 Ok(HostAlignedByteCount::ZERO) in byte_count_ops()
364 Ok(HostAlignedByteCount::host_page_size()) in byte_count_ops()