1 个不稳定版本
0.1.0 | 2021年10月24日 |
---|
#76 在 #data-encoding
在 bakery 中使用
5KB
57 行
Bakery
一个用于从结构化文本数据文件反序列化二进制对象的 Rust 库。
基本示例
use bakery::load_from_string;
use bakery_derive::Recipe;
use serde::Deserialize;
#[derive(Recipe, Deserialize)]
struct GameConfig {
width: u32,
height: u32,
fullscreen: bool
}
let config: GameConfig = load_from_string("width: 1024, height: 768, fullscreen: true");
许可协议
在以下任一许可协议下发布:
- Apache License, Version 2.0 (LICENSE-APACHE 或 http://apache.ac.cn/licenses/LICENSE-2.0)
- MIT 许可协议 (LICENSE-MIT 或 http://opensource.org/licenses/MIT)
任选其一。
贡献
除非您明确声明,否则您提交给包含在作品中的任何贡献(根据 Apache-2.0 许可证定义),将按上述方式双重许可,无需任何额外的条款或条件。
依赖项
~1.5MB
~35K SLoC