Try to serializes your data/tables to const rust code using Debug
trait.
This crate was inspired by the this Github issue.
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! to embed the generated code into your crate.
For full documentation see - https://docs.rs/constuneval
There are some cases when constuneval
will be unable to generate valid code. Namely:
- This serializer is intended for use with types with well implemented Debug trait. It may not work if Debug trait is producing invalid outputs.
- Using
UnevalCow
with refrence types (likeUnevalCow<&T>
) is not supported for now. See this for full explanation.
MIT