https://github.com/ashutoshvarma/constuneval
https://docs.rs/constuneval
https://github.com/ashutoshvarma/constuneval
Last synced: about 1 month ago
JSON representation
https://docs.rs/constuneval
- Host: GitHub
- URL: https://github.com/ashutoshvarma/constuneval
- Owner: ashutoshvarma
- License: mit
- Created: 2021-02-20T07:26:32.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T08:26:21.000Z (over 1 year ago)
- Last Synced: 2024-10-30T00:36:32.958Z (7 months ago)
- Language: Rust
- Size: 14.6 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# constuneval
Try to serializes your data/tables to const rust code using `Debug` trait.
## Why?
This crate was inspired by the this
[Github issue](https://github.com/not-yet-awesome-rust/not-yet-awesome-rust/issues/93).## Usage
This crate can be used form your build script. It will try to serialize data/tables you provide to any file you specify. After that you can use [include!](https://doc.rust-lang.org/stable/std/macro.include.html)
to embed the generated code into your crate.For full documentation see - https://docs.rs/constuneval
## Limitations
There are some cases when `constuneval` will be unable to generate valid code. Namely:
1. This serializer is intended for use with types with well implemented Debug trait. It may not
work if Debug trait is producing invalid outputs.
2. Using `UnevalCow` with refrence types (like `UnevalCow<&T>`) is not supported for now. See [this](https://github.com/not-yet-awesome-rust/not-yet-awesome-rust/issues/93#issuecomment-782808921) for full explanation.## Credit
[uneval](https://github.com/Cerberuser/uneval) and [@burdges](https://github.com/burdges)## License
MIT