[−][src]Struct os_units::Bytes
A struct representing byte size.
Implementations
impl Bytes
[src]
pub const fn new(bytes: usize) -> Self
[src]
Creates a new instance with given value.
pub const fn zero() -> Self
[src]
Equivalent to Bytes::new(0)
.
pub const fn as_usize(self) -> usize
[src]
Returns the value.
pub const fn as_num_of_pages<T: PageSize>(self) -> NumOfPages<T>
[src]
Converts bytes to the number of physical pages. Note that the number of physical pages will be calculated so that the specified bytes will be fit in pages.
Trait Implementations
impl Add<Bytes> for Bytes
[src]
type Output = Bytes
The resulting type after applying the +
operator.
pub fn add(self, rhs: Bytes) -> Self
[src]
impl AddAssign<Bytes> for Bytes
[src]
pub fn add_assign(&mut self, rhs: Bytes)
[src]
impl AddAssign<usize> for Bytes
[src]
pub fn add_assign(&mut self, rhs: usize)
[src]
impl Clone for Bytes
[src]
pub fn clone(&self) -> Bytes
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Bytes
[src]
impl Debug for Bytes
[src]
impl Div<usize> for Bytes
[src]
type Output = Bytes
The resulting type after applying the /
operator.
pub fn div(self, rhs: usize) -> Self::Output
[src]
impl DivAssign<usize> for Bytes
[src]
pub fn div_assign(&mut self, rhs: usize)
[src]
impl Eq for Bytes
[src]
impl Mul<Bytes> for Bytes
[src]
type Output = Bytes
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Bytes) -> Self::Output
[src]
impl Mul<usize> for Bytes
[src]
type Output = Bytes
The resulting type after applying the *
operator.
pub fn mul(self, rhs: usize) -> Self::Output
[src]
impl MulAssign<Bytes> for Bytes
[src]
pub fn mul_assign(&mut self, rhs: Bytes)
[src]
impl MulAssign<usize> for Bytes
[src]
pub fn mul_assign(&mut self, rhs: usize)
[src]
impl Ord for Bytes
[src]
pub fn cmp(&self, other: &Bytes) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Bytes> for Bytes
[src]
impl PartialOrd<Bytes> for Bytes
[src]
pub fn partial_cmp(&self, other: &Bytes) -> Option<Ordering>
[src]
pub fn lt(&self, other: &Bytes) -> bool
[src]
pub fn le(&self, other: &Bytes) -> bool
[src]
pub fn gt(&self, other: &Bytes) -> bool
[src]
pub fn ge(&self, other: &Bytes) -> bool
[src]
impl StructuralEq for Bytes
[src]
impl StructuralPartialEq for Bytes
[src]
impl Sub<Bytes> for Bytes
[src]
type Output = Bytes
The resulting type after applying the -
operator.
pub fn sub(self, rhs: Bytes) -> Self
[src]
impl SubAssign<Bytes> for Bytes
[src]
pub fn sub_assign(&mut self, rhs: Bytes)
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,