pub struct Byte(/* private fields */);
Expand description
The structure for representing a specific number of bytes.
Trait Implementations§
Source§impl Add for Byte
impl Add for Byte
Source§impl Debug for Byte
impl Debug for Byte
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Formats the represented byte value using the given formatter in a programmer-facing, debugging context.
§Example
use memory_size_type::Byte;
let one_byte = Byte::from(1);
let several_bytes = Byte::from(256);
assert_eq!("1 byte", format!("{}", one_byte));
assert_eq!("256 bytes", format!("{}", several_bytes));
Source§impl Display for Byte
impl Display for Byte
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Formats the represented byte value using the given formatter.
§Example
use memory_size_type::Byte;
let one_byte = Byte::from(1);
let several_bytes = Byte::from(256);
assert_eq!("1 byte", format!("{}", one_byte));
assert_eq!("256 bytes", format!("{}", several_bytes));
Auto Trait Implementations§
impl Freeze for Byte
impl RefUnwindSafe for Byte
impl Send for Byte
impl Sync for Byte
impl Unpin for Byte
impl UnwindSafe for Byte
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