Crate ferro_type

Crate ferro_type 

Source
Expand description

Ferrotype: Rust-to-TypeScript type mapping for Zed RPC

This crate provides traits for generating TypeScript type definitions from Rust types, enabling type-safe RPC communication.

§Core Design

The core abstraction is the TypeScript trait, modeled after serde’s Serialize. Rather than returning strings directly, it returns a TypeDef intermediate representation that can be:

  • Rendered to TypeScript syntax
  • Analyzed for type dependencies
  • Deduplicated for cleaner output
  • Extended for additional targets

Structs§

Field
A field in an object type.
TypeRegistry
A registry for collecting and managing TypeScript type definitions.

Enums§

Literal
A literal TypeScript type with a specific value.
Primitive
Primitive TypeScript types.
TypeDef
Intermediate representation for TypeScript types.

Traits§

TypeScript
The core trait for types that can be represented as TypeScript.

Functions§

extract_object_fields
Extracts fields from an Object TypeDef, unwrapping Named if necessary.
inline_typedef
Extracts the inner type definition, unwrapping Named if necessary.

Derive Macros§

TypeScript
Derive macro for generating TypeScript type definitions from Rust types.