forma_core 0.1.0

Core serialization and deserialization framework — data model, traits, error types.
Documentation
  • Coverage
  • 40.84%
    127 out of 311 items documented0 out of 210 items with examples
  • Size
  • Source code size: 189.89 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 28.6 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 18s Average build duration of successful builds.
  • all releases: 18s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • scalecode-solutions

forma_core

Core serialization and deserialization framework for forma -- data model, traits, and error types.

Most users should depend on forma instead of using this crate directly.

Overview

forma_core defines the traits and types that make up the forma data model:

  • Serialize / Serializer -- convert Rust values into a format-neutral data model (30 types).
  • Deserialize / Deserializer / Visitor -- reconstruct Rust values from serialized data.
  • Content -- buffering system for flatten and tagged enum support.
  • SerError / DeError -- trait-based errors that carry type context from the start.
  • Impossible -- uninhabitable type for compound traits a format does not support.
  • forward_to_deserialize_any! -- macro for self-describing formats.
  • IntoDeserializer and de::value -- ready-made building-block deserializers for format authors.

Includes Serialize and Deserialize impls for 60+ standard library types.

no_std Support

forma_core works without the standard library:

[dependencies]
forma_core = { version = "0.1", default-features = false, features = ["alloc"] }

The alloc feature enables collections, String, Content, and related impls. Primitive serialization and deserialization works with no features at all.

License

Licensed under either of Apache License, Version 2.0 or MIT License at your option.