Skip to content
forked from media-io/yaserde

Yet Another Serializer/Deserializer

License

Notifications You must be signed in to change notification settings

antis81/yaserde

This branch is 6 commits ahead of, 22 commits behind media-io/yaserde:main.

Folders and files

NameName
Last commit message
Last commit date
Jan 3, 2024
Feb 17, 2023
Jun 17, 2024
Jun 5, 2024
Jun 5, 2024
Sep 12, 2021
Feb 8, 2021
May 31, 2021
Apr 9, 2018
Apr 7, 2022
May 23, 2018

Repository files navigation

yaserde   Build Status Latest Version Coverage Status

Yet Another Serializer/Deserializer specialized for XML

Goal

This library will support XML de/ser-ializing with all specific features.

Supported types

  • Struct
  • Vec
  • Enum
  • Enum with complex types
  • Option
  • String
  • bool
  • number (u8, i8, u32, i32, f32, f64)

Attributes

  • attribute: this field is defined as an attribute
  • default: defines the default function to init the field
  • flatten: Flatten the contents of the field
  • namespace: defines the namespace of the field
  • rename: be able to rename a field
  • root: rename the based element. Used only at the XML root.
  • skip_serializing: Exclude this field from the serialized output. More details...
  • skip_serializing_if: Skip the serialisation for this field if the condition is true. More details...
  • 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

impl YaDeserialize for MyType {
  fn deserialize<R: Read>(reader: &mut yaserde::de::Deserializer<R>) -> Result<Self, String> {
    // deserializer code
  }
}
impl YaSerialize for MyType {
  fn serialize<W: Write>(&self, writer: &mut yaserde::ser::Serializer<W>) -> Result<(), String> {
    // serializer code
  }
}

About

Yet Another Serializer/Deserializer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%