pub struct Bytes<T: Int = usize>(/* private fields */);Expand description
Size calculated in Unit::Byte
Implementations§
Source§impl 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§
impl<T: Copy + Int> Copy for Bytes<T>
impl<T: Eq + Int> Eq for Bytes<T>
impl<T: PartialEq + Int> StructuralPartialEq for Bytes<T>
Auto Trait Implementations§
impl<T> Freeze for Bytes<T>where
T: Freeze,
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> UnsafeUnpin for Bytes<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Bytes<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more