agronholm / agronholm/cbor2

Annotated hex callback

未關閉
#237 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
enhancement
主要語言
Rust
星號
305
分支
79
平均合併
21 小時 59 分鐘
30 天內合併 PR
2

描述

### Things to check first

- [X] I have searched the existing issues and didn't find my feature already requested there

### Feature description

Please add the ability to register a visitor callback for each invocation and return of the parser or serializer.

### Use case

This would allow the callback function to record the type, its stack depth, and its position in the byte stream, enabling generation of the "Annotated hex" view of a CBOR blob:

Hex:
`82A1011901F4C077313938352D30342D31325432333A32303A35302E35325A`

Annotated Hex:
```
82 # array(2)
A1 # map(1)
01 # unsigned(1)
19 01F4 # unsigned(500)
C0 # tag(0)
77 # text(23)
313938352D30342D31325432333A32303A35302E35325A # "1985-04-12T23:20:50.52Z"
```

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。