Struct etternaonline_api::FileSize[][src]

pub struct FileSize { /* fields omitted */ }

Represents a file size

Implementations

impl FileSize[src]

pub fn from_bytes(bytes: u64) -> Self[src]

Create a new file size from the given number of bytes

pub fn bytes(self) -> u64[src]

Get the number of bytes

pub fn kb(self) -> u64[src]

Get the number of kilobytes, rounded down

pub fn mb(self) -> u64[src]

Get the number of megabytes, rounded down

pub fn gb(self) -> u64[src]

Get the number of gigabytes, rounded down

pub fn tb(self) -> u64[src]

Get the number of terabytes, rounded down

Trait Implementations

impl Clone for FileSize[src]

impl Copy for FileSize[src]

impl Debug for FileSize[src]

impl Default for FileSize[src]

impl Eq for FileSize[src]

impl FromStr for FileSize[src]

type Err = FileSizeParseError

The associated error which can be returned from parsing.

impl Hash for FileSize[src]

impl Ord for FileSize[src]

impl PartialEq<FileSize> for FileSize[src]

impl PartialOrd<FileSize> for FileSize[src]

impl StructuralEq for FileSize[src]

impl StructuralPartialEq for FileSize[src]

Auto Trait Implementations

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.