#hex-dump #formatting

extfmt

Extended formatting options for commmon types

3 unstable releases

0.2.0 Dec 31, 2025
0.1.1 Sep 29, 2017
0.1.0 Sep 29, 2017

#49 in Value formatting

Download history 109238/week @ 2025-10-12 122858/week @ 2025-10-19 137435/week @ 2025-10-26 136874/week @ 2025-11-02 129871/week @ 2025-11-09 127504/week @ 2025-11-16 59562/week @ 2025-11-23 30947/week @ 2025-11-30 22590/week @ 2025-12-07 22172/week @ 2025-12-14 12189/week @ 2025-12-21 8091/week @ 2025-12-28 26917/week @ 2026-01-04 24890/week @ 2026-01-11 8138/week @ 2026-01-18 8786/week @ 2026-01-25

69,861 downloads per month
Used in 11 crates (3 directly)

Apache-2.0

9KB
149 lines

extfmt

A crate with additional formatting options for Rust types

Usage

Add the dependency to your Cargo.toml:

[dependencies]
extfmt = "0.1"
extern crate extfmt;

use extfmt::*;

fn main() {
	// Wrapper types for prettier printing of slices.
	//
	// The string is formatted in a "slice" form, and supports most 
	// format specifiers as long as the underlying type implements them
	//
	// This prints "[01, 02, ff, 40]"
	println!("{:02x}", CommaSeparated(&[1, 2, 255, 64]));

	// Compact formatting of byte slices:
	// This prints "0102ff40".
	println!("{}", Hexlify(&[1, 2, 255, 64]));

	// Pretty buffer printing using `hexdump`.
	println!("{}", hexdump!(&[1u8, 2, 255, 64]));
	// 	 => 00000000	01 02 ff 40

	// Hexdump can also be used as a memory view for Sized types.
	println!("{}", hexdump!(64));
	//   => 00000000	40 00 00 00

	// Further hexdump options
	println!("{}", hexdump!(64, show_index: false));
	//   => 40 00 00 00
}

No runtime deps