Struct humanize_rs::bytes::Bytes
source · Expand description
Size calculated in Unit::Byte
Implementations
sourceimpl Bytes
impl Bytes
sourcepub fn new<T: Int>(value: T, unit: Unit) -> Result<Bytes<T>, ParseError>
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
sourceimpl<T: PartialEq + Int> PartialEq<Bytes<T>> for Bytes<T>
impl<T: PartialEq + Int> PartialEq<Bytes<T>> for Bytes<T>
impl<T: Copy + Int> Copy for Bytes<T>
impl<T: Eq + Int> Eq for Bytes<T>
impl<T: Int> StructuralEq for Bytes<T>
impl<T: Int> StructuralPartialEq for Bytes<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Bytes<T>where
T: RefUnwindSafe,
impl<T> Send for Bytes<T>where
T: Send,
impl<T> Sync for Bytes<T>where
T: Sync,
impl<T> Unpin for Bytes<T>where
T: Unpin,
impl<T> UnwindSafe for Bytes<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more