mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-30 09:38:24 -05:00
* wip * add table macro * add simple put get test with Address * add Env.view and Env.update * docs * slightly change the test * add initial table initialization and placeholders * lint & some * replace String with str * add error.rs * add docs to encode * add docs * clamp * add source on libmdbx_max_page_size * add BlockNumer_BlockHash * add scale * set header filed to bytes Bytes * remove unwrap * restrict scale to chosen types * into bytes * add postcard * changed to BlockNumHash * add proc_macro_attribute codecs * fix feature flagging * set a version for postcard * cleanup * seal ScaleOnly * remove unnecessary dependencies * properly encode/decode blocknumhash * change Account codec to scale * add missing feature to scale * add codec to a couple more types * silence clippy * add docs about table encoding * move and add reth-codecs * clippy * make proc-macro visible * add README.md
22 lines
703 B
Markdown
22 lines
703 B
Markdown
# codecs
|
|
|
|
This crate allows to easily configure different codecs for different purposes (benchmarks, user configuration) with minimal changes. Having them to be configurable through annotations allows us to contain their implementations/leakage to isolated portions of the project.
|
|
|
|
|
|
Example:
|
|
|
|
[Header struct](../primitives/src/header.rs)
|
|
|
|
[DB usage](../db/src/kv/codecs/scale.rs)
|
|
|
|
|
|
## Features
|
|
|
|
Feature defines what is the main codec used by `#[main_codec]`. However it is still possible to define them directly: `#[use_scale]`, `#[use_postcat]`, `#[no_codec]`.
|
|
|
|
```rust
|
|
default = ["scale"]
|
|
scale = ["codecs-derive/scale"]
|
|
postcard = ["codecs-derive/postcard"]
|
|
no_codec = ["codecs-derive/no_codec"]
|
|
``` |