awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
idanarye avatar

idanarye/rust-typed-builder

0
View on GitHub↗
1,173 stars·60 forks·Rust·Apache-2.0·22 viewscrates.io/crates/typed-builder↗

Rust Typed Builder

This library provides a procedural macro utility for Rust that automates the implementation of type-safe builder patterns. By leveraging the compiler to enforce structural integrity, it ensures that all mandatory fields are initialized and that objects are constructed in a valid state before the program executes.

The project distinguishes itself by using typestate-based tracking and marker types to encode the initialization progress of an object directly into the type system. This approach allows for a zero-cost abstraction layer where all validation logic and state checks are resolved during compilation, eliminating the need for runtime checks or memory overhead.

The builder generation logic supports a wide range of configuration options, including custom default values, optional field handling, and setter input transformations. It enables the creation of fluent, chainable interfaces that simplify the initialization of complex data structures while maintaining strict compile-time data validation.

The library is distributed as a derive macro, allowing developers to integrate builder functionality into custom data structures through standard attribute-based annotations.

Features

  • Type-Safe Configuration Builders - Generates type-safe builder patterns that enforce mandatory field assignment and prevent duplicate assignments at compile time.
  • Type-Safe Query Construction - Ensures all mandatory struct fields are assigned at compile time to prevent runtime initialization errors.
  • Build-Time Validation - Enforces strict data integrity rules during the object building process to guarantee valid states.
  • Typestate Trackers - Encodes initialization progress into the type system to prevent incomplete object construction.
  • Procedural Macros - Automates the generation of builder structs and methods at compile time using procedural macros.
  • Builder Libraries - Generates type-safe builder patterns for structs at compile time to ensure all mandatory fields are initialized.
  • Required Field Enforcement - Validates that all mandatory fields are assigned during construction to prevent runtime errors.
  • Automatic Trait Conversions - Automatically transforms setter arguments into required field types using generic trait bounds.
  • Phantom Data Patterns - Uses zero-sized marker types to track builder state at compile time without adding runtime memory overhead.
  • Struct Initializer Patterns - Simplifies complex object creation through automated default values, optional fields, and input conversions.
  • Object Field Optionality - Enables marking specific fields as optional to allow omission during object construction.
  • Schema Default Values - Assigns custom default values to fields for automatic population during construction.
  • Zero-Overhead Abstractions - Resolves all builder logic and type checks during compilation to eliminate runtime overhead.
  • Compile-Time Type Validation - Validates struct construction logic during compilation to enforce data integrity.
  • Fluent Builder APIs - Provides ergonomic, chainable builder interfaces for configuring complex data structures.

Star history

Star history chart for idanarye/rust-typed-builderStar history chart for idanarye/rust-typed-builder

How this analysis was created: This summary and feature list are AI-generated from collected project material and can contain mistakes. Stars, license and language are imported from GitHub. Inclusion does not mean that we have tested or audited this project. Check the source documentation for any feature you depend on. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Projects sharing features with Rust Typed Builder

These projects share indexed features with Rust Typed Builder. Shared tags can include platform or build tooling; verify the primary use case before treating a result as a replacement.
  • open-circle/valibotopen-circle avatar

    open-circle/valibot

    8,769View on GitHub↗

    Valibot is a modular, type-safe schema library for validating and parsing structural data in TypeScript environments.

    TypeScriptbundle-sizemodularparsing
    View on GitHub↗8,769
  • digitallyinduced/ihpdigitallyinduced avatar

    digitallyinduced/ihp

    5,294View on GitHub↗

    ihp is a type-safe web framework and full-stack application orchestrator designed for PostgreSQL. It functions as a server-side rendering framework and a type-safe ORM that automatically generates record types from SQL schemas to ensure compile-time query validation. The platform distinguishes itself by verifying routing, database queries, and templates at compile time to prevent runtime crashes. It implements real-time web interfaces using WebSockets for instant data synchronization and employs server-driven hypermedia for partial DOM patching. The framework covers a broad range of integrat

    Haskellframeworkhacktoberfesthaskell
    View on GitHub↗5,294
  • caarlos0/envcaarlos0 avatar

    caarlos0/env

    6,004View on GitHub↗

    env is a Go library that reads environment variables and populates the fields of a Go struct according to tag directives. It uses reflection to iterate over struct types and tags at runtime, mapping environment variable names to struct fields and applying parsing behavior defined in struct tags. The library supports required field validation, returning errors when marked fields are missing or empty after parsing. It also provides default value fallback from struct tags when environment variables are not set, environment variable expansion that recursively substitutes references within values,

    Goconfigconfigurationenvironment
    View on GitHub↗6,004
  • dtolnay/thiserrordtolnay avatar

    dtolnay/thiserror

    5,459View on GitHub↗

    thiserror is a Rust error handling library and procedural macro designed to define custom error types. It functions as a trait implementation automator that generates the necessary code for standard library error traits at compile time. The library focuses on eliminating boilerplate by using derive macros to automatically implement display and source methods. It allows for the creation of custom error structs and enums that can map low-level errors to high-level variants while preserving the original cause and backtrace information. Its capabilities cover custom error formatting through temp

    Rust
    View on GitHub↗5,459
Compare all 30 related projects→

Frequently asked questions

What does idanarye/rust-typed-builder do?

This library provides a procedural macro utility for Rust that automates the implementation of type-safe builder patterns. By leveraging the compiler to enforce structural integrity, it ensures that all mandatory fields are initialized and that objects are constructed in a valid state before the program executes.

What are the main features of idanarye/rust-typed-builder?

The main features of idanarye/rust-typed-builder are: Type-Safe Configuration Builders, Type-Safe Query Construction, Build-Time Validation, Typestate Trackers, Procedural Macros, Builder Libraries, Required Field Enforcement, Automatic Trait Conversions.

Which projects share features with idanarye/rust-typed-builder?

Projects with overlapping indexed features include: open-circle/valibot — Valibot is a modular, type-safe schema library for validating and parsing structural data in TypeScript environments. dtolnay/thiserror — thiserror is a Rust error handling library and procedural macro designed to define custom error types. It functions as… digitallyinduced/ihp — ihp is a type-safe web framework and full-stack application orchestrator designed for PostgreSQL. It functions as a… caarlos0/env — env is a Go library that reads environment variables and populates the fields of a Go struct according to tag… stephenafamo/bob — This project is a database toolkit for Go that provides schema-to-object mapping, fluent query construction, and… rust-lang/book — The Rust Programming Language Book is the official technical guide and educational resource for the Rust language. It…

Curated searches featuring Rust Typed Builder

Hand-picked collections where Rust Typed Builder appears.
  • Code generation tools