type_description
This crate provides machine-readable descriptions for types.
For a general overview, please check out the guide.
The idea is to make types discoverable for users by explaining them in a way
that a user can understand without knowing implementation details (a u16 is
an "integer with 16 bit")
Example
One could make configuration types explained with this crate and show the explanation (in a GUI, web interface, some special config-editor) to the user.
use AsTypeDescription;
use TypeDescription;
use TypeKind;
use Sign;
/// A configuration
let desc = as_type_description;
assert_eq!;
assert_eq!;
assert!;
match desc.kind
Extra Types
This crate contains a AsTypeDescription implementation for various third party crates.
The up to date list can be found on docs.rs.
Goals
- Follow the
serdemodel and be compatible with allserde::{Deserialize, Serialize}types - Produce machine-readable description for types implementing
AsTypeDescription
Non-Goals
- Allow constructing values through
TypeDescription(serde::Deserializeshould be preferred for that) - Any form of reflection
License
MPL-2.0