[][src]Struct os_units::Bytes

#[repr(transparent)]pub struct Bytes { /* fields omitted */ }

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.

impl AddAssign<Bytes> for Bytes[src]

impl AddAssign<usize> for Bytes[src]

impl Clone for Bytes[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.

impl DivAssign<usize> for Bytes[src]

impl Eq for Bytes[src]

impl Mul<Bytes> for Bytes[src]

type Output = Bytes

The resulting type after applying the * operator.

impl Mul<usize> for Bytes[src]

type Output = Bytes

The resulting type after applying the * operator.

impl MulAssign<Bytes> for Bytes[src]

impl MulAssign<usize> for Bytes[src]

impl Ord for Bytes[src]

impl PartialEq<Bytes> for Bytes[src]

impl PartialOrd<Bytes> for Bytes[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.

impl SubAssign<Bytes> for Bytes[src]

Auto Trait Implementations

impl Send for Bytes[src]

impl Sync for Bytes[src]

impl Unpin for Bytes[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.