项目作者: wcampbell0x2a

项目描述 :
Create bytefield latex digrams with the use of rust proc-macros and deku
高级语言: Rust
项目地址: git://github.com/wcampbell0x2a/bintex.git
创建时间: 2021-05-29T03:51:29Z
项目社区:https://github.com/wcampbell0x2a/bintex

开源协议:MIT License

下载


bintex

github
crates.io
docs.rs
build status

Create LaTeX bytefield diagrams with the
use of rust proc-macros and the deku library.

docs

run $ cargo doc --open

See bintex::attribute for Attribute details and examples.

example

Run $ cargo run && pdflatex sample.tex to create the following illustration from code:

  1. use bintex::{BinTex, BinTexOutput};
  2. use deku::prelude::*;
  3. #[derive(BinTex)]
  4. #[bintex(bit_width = 32)]
  5. struct Ipv6 {
  6. #[deku(bits = "4")]
  7. version: u8,
  8. #[deku(bits = "6")]
  9. ds: u8,
  10. #[deku(bits = "2")]
  11. ecn: u8,
  12. #[deku(bits = "20")]
  13. label: u32,
  14. length: u16,
  15. next_header: u8,
  16. hop_limit: u8,
  17. src: u32,
  18. dst: u32,
  19. }

Result