pub struct BytesCount { /* private fields */ }Expand description
Process N bytes.
Implementations§
Source§impl BytesCount
impl BytesCount
Sourcepub fn new<N>(count: N) -> BytesCountwhere
N: CountUInt,
pub fn new<N>(count: N) -> BytesCountwhere
N: CountUInt,
Count N bytes.
Sourcepub const fn of<T>() -> BytesCount
pub const fn of<T>() -> BytesCount
Counts the size of a type with size_of.
Sourcepub const fn of_many<T>(n: usize) -> BytesCount
pub const fn of_many<T>(n: usize) -> BytesCount
Counts the size of multiple instances of a type with size_of.
Sourcepub fn of_val<T>(val: &T) -> BytesCountwhere
T: ?Sized,
pub fn of_val<T>(val: &T) -> BytesCountwhere
T: ?Sized,
Counts the size of a value with size_of_val.
Sourcepub fn of_iter<T, I>(iter: I) -> BytesCountwhere
I: IntoIterator<Item = T>,
pub fn of_iter<T, I>(iter: I) -> BytesCountwhere
I: IntoIterator<Item = T>,
Counts the bytes of Iterator::Items.
Sourcepub fn of_str<S>(s: &S) -> BytesCount
pub fn of_str<S>(s: &S) -> BytesCount
Counts the bytes of a &str.
This is like BytesCount::of_val with the convenience of behaving as
expected for &String and other types that convert to
&str.
Source§impl BytesCount
Count bytes of multiple values.
impl BytesCount
Count bytes of multiple values.
Sourcepub const fn f32(n: usize) -> BytesCount
pub const fn f32(n: usize) -> BytesCount
Counts the bytes of multiple
f32s.
Sourcepub const fn f64(n: usize) -> BytesCount
pub const fn f64(n: usize) -> BytesCount
Counts the bytes of multiple
f64s.
Sourcepub const fn i8(n: usize) -> BytesCount
pub const fn i8(n: usize) -> BytesCount
Counts the bytes of multiple
i8s.
Sourcepub const fn u8(n: usize) -> BytesCount
pub const fn u8(n: usize) -> BytesCount
Counts the bytes of multiple
u8s.
Sourcepub const fn i16(n: usize) -> BytesCount
pub const fn i16(n: usize) -> BytesCount
Counts the bytes of multiple
i16s.
Sourcepub const fn u16(n: usize) -> BytesCount
pub const fn u16(n: usize) -> BytesCount
Counts the bytes of multiple
u16s.
Sourcepub const fn i32(n: usize) -> BytesCount
pub const fn i32(n: usize) -> BytesCount
Counts the bytes of multiple
i32s.
Sourcepub const fn u32(n: usize) -> BytesCount
pub const fn u32(n: usize) -> BytesCount
Counts the bytes of multiple
u32s.
Sourcepub const fn i64(n: usize) -> BytesCount
pub const fn i64(n: usize) -> BytesCount
Counts the bytes of multiple
i64s.
Sourcepub const fn u64(n: usize) -> BytesCount
pub const fn u64(n: usize) -> BytesCount
Counts the bytes of multiple
u64s.
Sourcepub const fn i128(n: usize) -> BytesCount
pub const fn i128(n: usize) -> BytesCount
Counts the bytes of multiple
i128s.
Sourcepub const fn u128(n: usize) -> BytesCount
pub const fn u128(n: usize) -> BytesCount
Counts the bytes of multiple
u128s.
Sourcepub const fn isize(n: usize) -> BytesCount
pub const fn isize(n: usize) -> BytesCount
Counts the bytes of multiple
isizes.
Sourcepub const fn usize(n: usize) -> BytesCount
pub const fn usize(n: usize) -> BytesCount
Counts the bytes of multiple
usizes.
Trait Implementations§
Source§impl Clone for BytesCount
impl Clone for BytesCount
Source§fn clone(&self) -> BytesCount
fn clone(&self) -> BytesCount
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BytesCount
impl Debug for BytesCount
Source§impl<C> From<C> for BytesCountwhere
C: AsCountUInt,
impl<C> From<C> for BytesCountwhere
C: AsCountUInt,
Source§fn from(count: C) -> BytesCount
fn from(count: C) -> BytesCount
Source§impl Ord for BytesCount
impl Ord for BytesCount
Source§fn cmp(&self, other: &BytesCount) -> Ordering
fn cmp(&self, other: &BytesCount) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for BytesCount
impl PartialEq for BytesCount
Source§impl PartialOrd for BytesCount
impl PartialOrd for BytesCount
impl Copy for BytesCount
impl Counter for BytesCount
impl Eq for BytesCount
impl StructuralPartialEq for BytesCount
Auto Trait Implementations§
impl Freeze for BytesCount
impl RefUnwindSafe for BytesCount
impl Send for BytesCount
impl Sync for BytesCount
impl Unpin for BytesCount
impl UnwindSafe for BytesCount
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<C> IntoCounter for Cwhere
C: Counter,
impl<C> IntoCounter for Cwhere
C: Counter,
Source§fn into_counter(self) -> <C as IntoCounter>::Counter
fn into_counter(self) -> <C as IntoCounter>::Counter
Counter.