dbgtools-hexdump 0.1.0

Hexdump functions for use in dbgtools.
Documentation
  • Coverage
  • 100%
    7 out of 7 items documented3 out of 5 items with examples
  • Size
  • Source code size: 4.88 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 350.58 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • openqrnch/dbgtools-hexdump
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • qrnch-jan
A hex dumper which calls a closure to allow the application to choose how to output the dump. # Example: Dumping a struct ``` use dbgtools_hexdump::{Config, hexdump}; struct MyStruct { eight: u8, sixteen: u16, thirtytwo: u32 } let data = MyStruct { eight: 8, sixteen: 16, thirtytwo: 32 }; hexdump(Config::default(), &data, |offs, hex, ascii| { println!("{:08x} {} {}", offs, hex, ascii); }); ``` # Example: Dumping a struct with addresses Sometimes it may be useful to include the real addresses in dumped buffers. This can be accomplished by adding a base offset to the configuration context. ``` use dbgtools_hexdump::{Config, hexdump}; struct MyStruct { eight: u8, sixteen: u16, thirtytwo: u32 } let data = MyStruct { eight: 8, sixteen: 16, thirtytwo: 32 }; hexdump(Config { offs: &data as *const _ as usize, ..Default::default() }, &data, |offs, hex, ascii| { println!("{:08x} {} {}", offs, hex, ascii); }); ```