sails_type_registry/lib.rs
1#![no_std]
2
3//! Portable type metadata and registry for Sails.
4//!
5//! This crate defines the metadata model used by Sails to describe Rust types
6//! in a portable form. Types implement [`TypeInfo`], and a [`Registry`]
7//! collects their descriptions into a deduplicated table that can be consumed
8//! by IDL generation and related tooling.
9//!
10//! Most users interact with this crate through `#[derive(TypeInfo)]`. Manual
11//! construction is available through the builder types re-exported here.
12
13pub extern crate alloc;
14pub use core;
15
16/// Builders for constructing [`ast::Type`] metadata manually.
17pub mod builder;
18/// Type-erased wrapper around a [`TypeInfo`] implementation.
19mod meta_type;
20/// Registry and trait entry points for portable type metadata.
21mod registry;
22/// Built-in `TypeInfo` implementations for standard Rust types.
23mod trait_impls;
24
25pub use crate::builder::{
26 CompositeBuilder, FieldBuilder, ParamBuilder, TypeBuilder, VariantBuilder, VariantDefBuilder,
27};
28pub use crate::meta_type::MetaType;
29pub use crate::registry::{Registry, TypeInfo, TypeRef, const_suffixed_name};
30pub use sails_idl_ast as ast;
31
32/// Derive macro for generating [`TypeInfo`] implementations.
33#[cfg(feature = "derive")]
34pub use sails_type_registry_derive::TypeInfo;