Function format_byte_size

Source
pub fn format_byte_size(buf: BytesMut, size: usize) -> BytesMut
Expand description

Formats a byte size into a human readable string with appropriate units (B, KB, MB, GB) The function will add decimal points for values between units (e.g., 1.5KB)

§Arguments

  • buf - BytesMut buffer to write the formatted string into
  • size - Size in bytes to format

§Returns

BytesMut buffer containing the formatted string