All Projects → type-metadata → type-metadata

type-metadata / type-metadata

Licence: Apache-2.0 license
Rust type metadata reflection library

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to type-metadata

Ta Rs
Technical analysis library for Rust language
Stars: ✭ 248 (+818.52%)
Mutual labels:  rust-library
contour-rs
Contour polygon creation in Rust (using marching squares algorithm)
Stars: ✭ 33 (+22.22%)
Mutual labels:  rust-library
codebreaker-rs
A Rust library to decrypt & encrypt any cheat code for CodeBreaker PS2
Stars: ✭ 18 (-33.33%)
Mutual labels:  rust-library
i2p-rs
Rust client library for interacting with I2P
Stars: ✭ 62 (+129.63%)
Mutual labels:  rust-library
Nebuchadnezzar
High Performance Key-Value Store
Stars: ✭ 49 (+81.48%)
Mutual labels:  rust-library
tentacle
A multiplexed p2p network framework that supports custom protocols
Stars: ✭ 41 (+51.85%)
Mutual labels:  rust-library
Sprs
sparse linear algebra library for rust
Stars: ✭ 224 (+729.63%)
Mutual labels:  rust-library
har-rs
A HTTP Archive format (HAR) serialization & deserialization library, written in Rust.
Stars: ✭ 25 (-7.41%)
Mutual labels:  rust-library
vfin
🦈 GUI framework agnostic virtual DOM library
Stars: ✭ 17 (-37.04%)
Mutual labels:  rust-library
ghakuf
A Rust library for parsing/building SMF (Standard MIDI File).
Stars: ✭ 30 (+11.11%)
Mutual labels:  rust-library
Awesome-Rust-MachineLearning
This repository is a list of machine learning libraries written in Rust. It's a compilation of GitHub repositories, blogs, books, movies, discussions, papers, etc. 🦀
Stars: ✭ 1,110 (+4011.11%)
Mutual labels:  rust-library
crc32c
Fast CRC-32-Castagnoli implementation in Rust
Stars: ✭ 26 (-3.7%)
Mutual labels:  rust-library
rust-phonenumber
Library for parsing, formatting and validating international phone numbers.
Stars: ✭ 99 (+266.67%)
Mutual labels:  rust-library
hidapi-rs
Rust bindings for the hidapi C library
Stars: ✭ 103 (+281.48%)
Mutual labels:  rust-library
shell2batch
Coverts simple basic shell scripts to windows batch scripts.
Stars: ✭ 42 (+55.56%)
Mutual labels:  rust-library
Horrorshow Rs
A macro-based html builder for rust
Stars: ✭ 228 (+744.44%)
Mutual labels:  rust-library
twitter-stream-rs
A Rust library for listening on Twitter Streaming API.
Stars: ✭ 66 (+144.44%)
Mutual labels:  rust-library
rsmorphy
Morphological analyzer / inflection engine for Russian and Ukrainian languages rewritten in Rust
Stars: ✭ 27 (+0%)
Mutual labels:  rust-library
rustgraphblas
rust-library to wrap GraphBLAS.h
Stars: ✭ 23 (-14.81%)
Mutual labels:  rust-library
colorful
Make your terminal output colorful.
Stars: ✭ 43 (+59.26%)
Mutual labels:  rust-library

type-metadata

Compactly serialize meta information about types in your crate.

Design

Design draft

Note: The design draft is outdated partially.

Overview

Types are describes by their identification (ID) and their structure or definition. The ID stores information about the name of the type, where the type has been defined and generic types communicate their generic arguments. The definition communicates the underlying serialization and deserialization structure of the type, possibly revealing internal fields etc.

The former is important to give a mean to differentiate types easily between each other and also provide a useful hint to users. The definitions provide third party tools, such as a UI client with information about how they are able to decode types language agnostically.

Internal Overview

Information about types is provided within the so-called type registry (Registry). Type identifiers and associated definitions are registered there and are associated with unique IDs that the outside can use to refer to them providing a lightweight way to decrease overhead of using type identifiers instead.

For the purpose of communicating type ID and definition there exists the HasTypeId and HasTypeDef respectively that is to be implemented by all supported types.

All concrete TypeId and TypeDef structures have two forms: One meta form (MetaType) that acts as a bridge to other forms and a compact form that is later to be serialized. The IntoCompact trait is implemented by them in order to compact a type ID or definition using an instance of a type registry.

After compactification all type ID and definitions are stored in the type registry. Note that during serialization the type registry should be serialized during general serialization procedure.

As a minor additional compaction step non-documentation strings are also compacted by the same mechanics.

Users

Simply build up any graph of data structures and use MetaType instances to communicate type information. Also provide an IntoCompact implementation that converts those MetaType instances into their compacted forms. Upon serialization do not forget to also serialize the type registry used for compaction.

Test

Generally test the crate with cargo test.

If you additionally want to test derive utilities, do cargo test --features derive.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].