yaserde
所属分类:collect
开发工具:Rust
文件大小:0KB
下载次数:0
上传日期:2023-03-20 06:57:43
上 传 者:
sh-1993
说明: 另一个序列化器反序列化器,
(Yet Another Serializer Deserializer,)
文件列表:
.travis.yml (1702, 2023-12-19)
Cargo.toml (73, 2023-12-19)
Changelog.md (433, 2023-12-19)
LICENSE (1065, 2023-12-19)
doc/ (0, 2023-12-19)
doc/skip_serializing.md (4167, 2023-12-19)
examples/ (0, 2023-12-19)
examples/Cargo.toml (331, 2023-12-19)
examples/release.toml (12, 2023-12-19)
examples/src/ (0, 2023-12-19)
examples/src/bbigras_namespace.rs (3282, 2023-12-19)
examples/src/boscop.rs (2824, 2023-12-19)
examples/src/lib.rs (56, 2023-12-19)
examples/src/ln_dom.rs (1915, 2023-12-19)
examples/src/svd.rs (4788, 2023-12-19)
examples/tests/ (0, 2023-12-19)
examples/tests/data/ (0, 2023-12-19)
examples/tests/data/bbigras-namespace.xml (612, 2023-12-19)
examples/tests/data/boscop.xml (28813, 2023-12-19)
examples/tests/data/ln-dom.xml (371, 2023-12-19)
examples/tests/data/svd.xml (1684, 2023-12-19)
rustfmt.toml (15, 2023-12-19)
yaserde/ (0, 2023-12-19)
yaserde/Cargo.toml (718, 2023-12-19)
yaserde/src/ (0, 2023-12-19)
yaserde/src/de/ (0, 2023-12-19)
yaserde/src/de/mod.rs (3286, 2023-12-19)
yaserde/src/lib.rs (9582, 2023-12-19)
yaserde/src/ser/ (0, 2023-12-19)
yaserde/src/ser/mod.rs (3727, 2023-12-19)
yaserde/tests/ (0, 2023-12-19)
yaserde/tests/default.rs (3628, 2023-12-19)
yaserde/tests/deserializer.rs (21912, 2023-12-19)
yaserde/tests/enum.rs (9076, 2023-12-19)
yaserde/tests/errors.rs (928, 2023-12-19)
yaserde/tests/flatten.rs (6105, 2023-12-19)
... ...
# yaserde [![Build Status]][travis] [![Latest Version]][crates.io] [![Coverage Status]][coveralls]
[Build Status]: https://travis-ci.com/media-io/yaserde.svg?branch=master
[travis]: https://travis-ci.com/media-io/yaserde
[Latest Version]: https://img.shields.io/crates/v/yaserde.svg
[crates.io]: https://crates.io/crates/yaserde
[Coverage Status]: https://coveralls.io/repos/github/media-io/yaserde/badge.svg?branch=master
[coveralls]: https://coveralls.io/github/media-io/yaserde?branch=master
**Yet Another Serializer/Deserializer specialized for XML**
## Goal
This library will support XML de/ser-ializing with all specific features.
## Supported types
- [x] Struct
- [x] Vec
- [x] Enum
- [x] Enum with complex types
- [x] Option
- [x] String
- [x] bool
- [x] number (u8, i8, u32, i32, f32, f64)
## Attributes
- [x] **attribute**: this field is defined as an attribute
- [x] **default**: defines the default function to init the field
- [x] **flatten**: Flatten the contents of the field
- [x] **namespace**: defines the namespace of the field
- [x] **rename**: be able to rename a field
- [x] **root**: rename the based element. Used only at the XML root.
- [x] **skip_serializing**: Exclude this field from the serialized output. [More details...](https://github.com/media-io/yaserde/blob/master/doc/skip_serializing.md)
- [x] **skip_serializing_if**: Skip the serialisation for this field if the condition is true. [More details...](https://github.com/media-io/yaserde/blob/master/doc/skip_serializing.md)
- [x] **text**: this field match to the text content
## Custom De/Ser-rializer
Any type can define a custom deserializer and/or serializer.
To implement it, define the implementation of YaDeserialize/YaSerialize
```rust
impl YaDeserialize for MyType {
fn deserialize(reader: &mut yaserde::de::Deserializer) -> Result {
// deserializer code
}
}
```
```rust
impl YaSerialize for MyType {
fn serialize(&self, writer: &mut yaserde::ser::Serializer) -> Result<(), String> {
// serializer code
}
}
```
近期下载者:
相关文件:
收藏者: