Struct humanize_rs::bytes::Bytes [−][src]
Size calculated in Unit::Byte
Methods
impl Bytes
[src]
impl Bytes
pub fn new<T: Int>(value: T, unit: Unit) -> Result<Bytes<T>, ParseError>
[src]
pub fn new<T: Int>(value: T, unit: Unit) -> Result<Bytes<T>, ParseError>
Returns a Bytes
with a numeric value and a specific unit, or a ParseError
if exists,
only ParseError::Overflow
here.
Example
use humanize_rs::bytes::{Bytes, Unit}; let megabytes = Bytes::new(1, Unit::MByte).unwrap();
Trait Implementations
impl<T: Debug + Int> Debug for Bytes<T>
[src]
impl<T: Debug + Int> Debug for Bytes<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: Copy + Int> Copy for Bytes<T>
[src]
impl<T: Copy + Int> Copy for Bytes<T>
impl<T: Clone + Int> Clone for Bytes<T>
[src]
impl<T: Clone + Int> Clone for Bytes<T>
fn clone(&self) -> Bytes<T>
[src]
fn clone(&self) -> Bytes<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<T: Eq + Int> Eq for Bytes<T>
[src]
impl<T: Eq + Int> Eq for Bytes<T>
impl<T: PartialEq + Int> PartialEq for Bytes<T>
[src]
impl<T: PartialEq + Int> PartialEq for Bytes<T>
fn eq(&self, other: &Bytes<T>) -> bool
[src]
fn eq(&self, other: &Bytes<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Bytes<T>) -> bool
[src]
fn ne(&self, other: &Bytes<T>) -> bool
This method tests for !=
.
impl<T: Int> FromStr for Bytes<T>
[src]
impl<T: Int> FromStr for Bytes<T>