pub trait ByteSizeExt: Sized + Copy {
const ZERO: Self;
// Required methods
fn from_bytes(bytes: u64) -> Self;
fn from_bytes_i64(bytes: i64) -> Self;
fn from_bytes_f64(bytes: f64) -> Self;
fn bytes_u64(self) -> u64;
fn bytes_usize(self) -> usize;
fn bytes_i32(self) -> i32;
fn bytes_i64(self) -> i64;
fn bytes_f64(self) -> f64;
}Expand description
Byte counts: construction from raw integers, and extraction back to them.
Required Associated Constants§
Required Methods§
Sourcefn from_bytes(bytes: u64) -> Self
fn from_bytes(bytes: u64) -> Self
A raw unsigned byte count.
Sourcefn from_bytes_i64(bytes: i64) -> Self
fn from_bytes_i64(bytes: i64) -> Self
A raw signed byte count. This keeps the sign, so it also carries a
delta, for example a quota balance that has gone into deficit. This
function does not interpret Kafka’s -1 “unlimited” sentinel. Use
wire::opt_size_from_bytes_i64 for that.
Sourcefn from_bytes_f64(bytes: f64) -> Self
fn from_bytes_f64(bytes: f64) -> Self
A raw byte count measured as a float (a sampled or averaged size).
Sourcefn bytes_usize(self) -> usize
fn bytes_usize(self) -> usize
The count as a usize, for buffer capacities and slice lengths.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".