# rustq v1.0.0-rc.19 - Table of Contents > Generate Rust code and Rustler NIFs from typed Elixir ## Pages - [RustQ](readme.md) - [RustQ internal structure](internals.md) - [Using RustQ Well](using-rustq-well.md) - [Generating Rustler Boundaries](rustler-generation.md) - [Designing RustQ Generators](designing-generators.md) - [Generating Rust](generating-rust.md) - [RustQ Reach plugin](reach-plugin.md) - [RustQ 1.x compatibility policy](compatibility.md) - [Zero-handwritten-Rust NIFs](zero-rust-nifs.md) - [SKILL](skill.md) - [Changelog](changelog.md) - [LICENSE](license.md) ## Modules - Start here - [RustQ](RustQ.md): Rust template quasiquoting and code generation. - [RustQ.Config](RustQ.Config.md): Concise manifest DSL for checked-in generated files. - [RustQ.Meta](RustQ.Meta.md): Valid-Elixir macro frontend for generating RustQ Rust fragments. - [RustQ.Native](RustQ.Native.md): Builds and loads a Rustler NIF crate generated entirely from Rusty-Elixir. - [RustQ.Rust](RustQ.Rust.md): Rendering boundary for structural RustQ AST and explicit Rust fragments. - [RustQ.Rust.Identifier](RustQ.Rust.Identifier.md): Safe conversion of finite generator names into Rust identifier atoms. - [RustQ.Rustler](RustQ.Rustler.md): Structural Rustler code generation. - [RustQ.Syn](RustQ.Syn.md): Structural metadata for Rust source parsed with [`syn`](https://docs.rs/syn). - [RustQ.Test](RustQ.Test.md): Composable ExUnit helpers for Rust generated by `defrust` and `defnif`. - [RustQ.Type](RustQ.Type.md): Built-in Rust/Rustler type vocabulary for `RustQ.Meta.defrust/2` specs. - Rustler generation - [RustQ.Rustler.Atom](RustQ.Rustler.Atom.md): Generates Rustler atom declarations, decoders, dispatchers, and cached atom helpers. - [RustQ.Rustler.Decode](RustQ.Rustler.Decode.md): AST helpers for composing Rustler term decoding expressions. - [RustQ.Rustler.Opts](RustQ.Rustler.Opts.md): Generates Rustler keyword/options structs, decoders, and option helper functions. - [RustQ.Rustler.Resource](RustQ.Rustler.Resource.md): Generates Rustler resource structs, handles, decoders, and initialization helpers. - [RustQ.Rustler.Schema](RustQ.Rustler.Schema.md): Schema DSL for generating Rustler structs and tagged enums. - [RustQ.Rustler.TaggedEnum](RustQ.Rustler.TaggedEnum.md): Generates Rust enums decoded from tagged Elixir struct or map terms. - [RustQ.Rustler.Term](RustQ.Rustler.Term.md): Generates Rustler `Term<'a>` builders, decoders, and map access helpers. - [RustQ.Rustler.Term.EncoderField](RustQ.Rustler.Term.EncoderField.md): One key of a generated map encoder: the field path it reads, whether it is always written or only when `Some`, and how its value is converted, borrowed, or defaulted. - Rust AST nodes - [RustQ.Rust.AST.Arm](RustQ.Rust.AST.Arm.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.ArrayLiteral](RustQ.Rust.AST.ArrayLiteral.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Assign](RustQ.Rust.AST.Assign.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.AssignOp](RustQ.Rust.AST.AssignOp.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.AtomValue](RustQ.Rust.AST.AtomValue.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Attribute](RustQ.Rust.AST.Attribute.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.BinaryOp](RustQ.Rust.AST.BinaryOp.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.BlockExpr](RustQ.Rust.AST.BlockExpr.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Break](RustQ.Rust.AST.Break.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.ByteString](RustQ.Rust.AST.ByteString.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Cast](RustQ.Rust.AST.Cast.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Closure](RustQ.Rust.AST.Closure.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Const](RustQ.Rust.AST.Const.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Continue](RustQ.Rust.AST.Continue.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Derive](RustQ.Rust.AST.Derive.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.EarlyReturn](RustQ.Rust.AST.EarlyReturn.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Enum](RustQ.Rust.AST.Enum.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.EnumVariant](RustQ.Rust.AST.EnumVariant.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Err](RustQ.Rust.AST.Err.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.EscapeExpr](RustQ.Rust.AST.EscapeExpr.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.ExprStmt](RustQ.Rust.AST.ExprStmt.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Field](RustQ.Rust.AST.Field.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.For](RustQ.Rust.AST.For.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Function](RustQ.Rust.AST.Function.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.FunctionArg](RustQ.Rust.AST.FunctionArg.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.If](RustQ.Rust.AST.If.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.IfLet](RustQ.Rust.AST.IfLet.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Impl](RustQ.Rust.AST.Impl.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Index](RustQ.Rust.AST.Index.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Let](RustQ.Rust.AST.Let.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.LetElse](RustQ.Rust.AST.LetElse.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Literal](RustQ.Rust.AST.Literal.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.LocalCall](RustQ.Rust.AST.LocalCall.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Loop](RustQ.Rust.AST.Loop.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.MacroCall](RustQ.Rust.AST.MacroCall.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.MacroCapture](RustQ.Rust.AST.MacroCapture.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.MacroItem](RustQ.Rust.AST.MacroItem.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.MacroItemCall](RustQ.Rust.AST.MacroItemCall.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.MacroRepeat](RustQ.Rust.AST.MacroRepeat.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.MacroRepeatExpr](RustQ.Rust.AST.MacroRepeatExpr.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.MacroRule](RustQ.Rust.AST.MacroRule.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.MacroRules](RustQ.Rust.AST.MacroRules.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.MacroVar](RustQ.Rust.AST.MacroVar.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Match](RustQ.Rust.AST.Match.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Metadata](RustQ.Rust.AST.Metadata.md): Structured Rust attribute metadata: paths, name/value entries, and nested lists. - [RustQ.Rust.AST.Metadata.List](RustQ.Rust.AST.Metadata.List.md): A metadata path containing ordered metadata entries. - [RustQ.Rust.AST.Metadata.NameValue](RustQ.Rust.AST.Metadata.NameValue.md): A metadata path with a string value. - [RustQ.Rust.AST.Metadata.Path](RustQ.Rust.AST.Metadata.Path.md): A bare metadata path. - [RustQ.Rust.AST.MethodCall](RustQ.Rust.AST.MethodCall.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Module](RustQ.Rust.AST.Module.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.NifRaiseAtom](RustQ.Rust.AST.NifRaiseAtom.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.None](RustQ.Rust.AST.None.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Ok](RustQ.Rust.AST.Ok.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.PatAtomGuard](RustQ.Rust.AST.PatAtomGuard.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.PatErr](RustQ.Rust.AST.PatErr.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.PatLiteral](RustQ.Rust.AST.PatLiteral.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.PatNone](RustQ.Rust.AST.PatNone.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.PatOk](RustQ.Rust.AST.PatOk.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.PatPath](RustQ.Rust.AST.PatPath.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.PatPathTuple](RustQ.Rust.AST.PatPathTuple.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.PatRef](RustQ.Rust.AST.PatRef.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.PatSlice](RustQ.Rust.AST.PatSlice.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.PatSome](RustQ.Rust.AST.PatSome.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.PatStruct](RustQ.Rust.AST.PatStruct.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.PatTuple](RustQ.Rust.AST.PatTuple.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.PatVar](RustQ.Rust.AST.PatVar.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.PatWildcard](RustQ.Rust.AST.PatWildcard.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Path](RustQ.Rust.AST.Path.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.PathCall](RustQ.Rust.AST.PathCall.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Range](RustQ.Rust.AST.Range.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Ref](RustQ.Rust.AST.Ref.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Return](RustQ.Rust.AST.Return.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Some](RustQ.Rust.AST.Some.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Static](RustQ.Rust.AST.Static.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Struct](RustQ.Rust.AST.Struct.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.StructField](RustQ.Rust.AST.StructField.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.StructLiteral](RustQ.Rust.AST.StructLiteral.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.TokenMacro](RustQ.Rust.AST.TokenMacro.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Try](RustQ.Rust.AST.Try.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Tuple](RustQ.Rust.AST.Tuple.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.TypeAlias](RustQ.Rust.AST.TypeAlias.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.TypeArray](RustQ.Rust.AST.TypeArray.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.TypeBareFn](RustQ.Rust.AST.TypeBareFn.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.TypeImplTrait](RustQ.Rust.AST.TypeImplTrait.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.TypeNifResult](RustQ.Rust.AST.TypeNifResult.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.TypeOption](RustQ.Rust.AST.TypeOption.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.TypePath](RustQ.Rust.AST.TypePath.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.TypeRaw](RustQ.Rust.AST.TypeRaw.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.TypeRef](RustQ.Rust.AST.TypeRef.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.TypeResult](RustQ.Rust.AST.TypeResult.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.TypeSlice](RustQ.Rust.AST.TypeSlice.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.TypeTuple](RustQ.Rust.AST.TypeTuple.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.TypeUnit](RustQ.Rust.AST.TypeUnit.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.TypeVec](RustQ.Rust.AST.TypeVec.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.UnaryOp](RustQ.Rust.AST.UnaryOp.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.UnsafeBlock](RustQ.Rust.AST.UnsafeBlock.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Use](RustQ.Rust.AST.Use.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.Var](RustQ.Rust.AST.Var.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - [RustQ.Rust.AST.VecLiteral](RustQ.Rust.AST.VecLiteral.md): Structural RustQ AST node. Prefer the focused builder modules for construction. - Rust AST - [RustQ.Rust.AST](RustQ.Rust.AST.md): Small Rust AST/IR used by macro frontends before final RustQ validation. - [RustQ.Rust.AST.Builder](RustQ.Rust.AST.Builder.md): Expression, statement, and simple item constructors for `RustQ.Rust.AST`. - [RustQ.Rust.AST.ItemBuilder](RustQ.Rust.AST.ItemBuilder.md): Constructors for Rust item declarations with Elixir block syntax. - [RustQ.Rust.AST.PatternBuilder](RustQ.Rust.AST.PatternBuilder.md): Constructors and normalization for Rust pattern AST nodes. - [RustQ.Rust.AST.TypeBuilder](RustQ.Rust.AST.TypeBuilder.md): Constructors and normalization for Rust type AST nodes. - [RustQ.Rust.AST.Walk](RustQ.Rust.AST.Walk.md): Generic traversal helpers for RustQ AST nodes. - Rust source metadata - [RustQ.Cargo](RustQ.Cargo.md): Helpers for discovering Rust package metadata through Cargo. - [RustQ.Cargo.Metadata](RustQ.Cargo.Metadata.md): Decoded subset of `cargo metadata` used by RustQ. - [RustQ.Cargo.Package](RustQ.Cargo.Package.md): Package entry from `cargo metadata`. - [RustQ.Native.Descriptor](RustQ.Native.Descriptor.md): Resolved metadata for a `RustQ.Native.Ref`. - [RustQ.Native.EnumDescriptor](RustQ.Native.EnumDescriptor.md): Resolved metadata for a native Rust enum. - [RustQ.Native.Ref](RustQ.Native.Ref.md): Reference to a Rust native item used by code generators. - [RustQ.Syn.Arg](RustQ.Syn.Arg.md): Rust function or method argument metadata. `type` is rendered Rust; `type_ast` is structured metadata. - [RustQ.Syn.Enum](RustQ.Syn.Enum.md): Rust enum metadata, including doc comments, variant names, and variant shapes. - [RustQ.Syn.Field](RustQ.Syn.Field.md): Rust struct field metadata. - [RustQ.Syn.File](RustQ.Syn.File.md): Rust source file metadata. - [RustQ.Syn.Function](RustQ.Syn.Function.md): Rust free function metadata, including doc comments, arguments, and return type. - [RustQ.Syn.Impl](RustQ.Syn.Impl.md): Rust impl block metadata, including target type, optional trait, doc comments, and methods. - [RustQ.Syn.Index](RustQ.Syn.Index.md): In-memory index of Rust source metadata parsed by `RustQ.Syn`. - [RustQ.Syn.Method](RustQ.Syn.Method.md): Rust impl or trait method metadata, including doc comments, arguments, and return type. - [RustQ.Syn.MethodCall](RustQ.Syn.MethodCall.md): Receiver method call metadata found in Rust source. - [RustQ.Syn.Signature](RustQ.Syn.Signature.md): Structured Rust function or method signature metadata. - [RustQ.Syn.Static](RustQ.Syn.Static.md): Rust static item metadata. - [RustQ.Syn.Struct](RustQ.Syn.Struct.md): Rust struct metadata. - [RustQ.Syn.Trait](RustQ.Syn.Trait.md): Rust trait metadata: its name, doc comments, associated types, and the methods it declares or provides. - [RustQ.Syn.Type](RustQ.Syn.Type.md): Namespace for structured Rust type metadata. - [RustQ.Syn.Type.Array](RustQ.Syn.Type.Array.md): Rust fixed-size array type metadata. - [RustQ.Syn.Type.Bound](RustQ.Syn.Type.Bound.md): One ordered `impl Trait` bound. - [RustQ.Syn.Type.Fn](RustQ.Syn.Type.Fn.md): Rust bare function pointer type metadata. - [RustQ.Syn.Type.GenericArgument](RustQ.Syn.Type.GenericArgument.md): One ordered Rust path generic argument. - [RustQ.Syn.Type.ImplTrait](RustQ.Syn.Type.ImplTrait.md): Rust impl Trait type metadata. - [RustQ.Syn.Type.Option](RustQ.Syn.Type.Option.md): Rust Option type metadata. - [RustQ.Syn.Type.Path](RustQ.Syn.Type.Path.md): Rust path type metadata, for example `Paint`, `skia_safe::Canvas`, or `AsRef`. - [RustQ.Syn.Type.Raw](RustQ.Syn.Type.Raw.md): Fallback Rust type metadata for type forms RustQ does not model structurally yet. - [RustQ.Syn.Type.Ref](RustQ.Syn.Type.Ref.md): Rust reference type metadata, for example `&Paint` or `&'a mut Path`. - [RustQ.Syn.Type.Result](RustQ.Syn.Type.Result.md): Rust Result type metadata. - [RustQ.Syn.Type.Self](RustQ.Syn.Type.Self.md): Rust Self type metadata. - [RustQ.Syn.Type.Slice](RustQ.Syn.Type.Slice.md): Rust slice type metadata. - [RustQ.Syn.Type.Tuple](RustQ.Syn.Type.Tuple.md): Rust tuple type metadata. - [RustQ.Syn.TypeAlias](RustQ.Syn.TypeAlias.md): Rust `type` alias metadata. - [RustQ.Syn.Use](RustQ.Syn.Use.md): Rust `use` item metadata, including reexport aliases. - [RustQ.Syn.Variant](RustQ.Syn.Variant.md): Rust enum variant metadata. - Rusty-Elixir metadata - [RustQ.Binding.Callable](RustQ.Binding.Callable.md): Normalized callable signature metadata for RustQ lowering and binding generation. - [RustQ.Binding.Callable.Arg](RustQ.Binding.Callable.Arg.md): A callable argument: its name, its type, and the Syn argument it was read from. - [RustQ.Binding.Index](RustQ.Binding.Index.md): Lookup table for normalized RustQ callable metadata. - [RustQ.Binding.Source](RustQ.Binding.Source.md): Resolves callable metadata from RustQ modules, Rust source files, and Cargo packages. - [RustQ.Binding.Substitution](RustQ.Binding.Substitution.md): Structural substitution for explicitly declared Rust type parameters. - [RustQ.Binding.TypeAliases](RustQ.Binding.TypeAliases.md): Source-backed Rust type alias expansion for native receiver inference. - [RustQ.Spec](RustQ.Spec.md): Public helpers for lowering Elixir typespec forms into RustQ type metadata. - Generation and templates - [RustQ.Generated](RustQ.Generated.md): File sync helpers for RustQ-generated sources. - [RustQ.Generated.StaleError](RustQ.Generated.StaleError.md): Raised when generated files differ from the contents produced by the manifest. - [RustQ.Rust.Fragment](RustQ.Rust.Fragment.md): Explicit Rust source fragment used at template splice boundaries. - [RustQ.Sigil](RustQ.Sigil.md): Provides the `~R` sigil for inline Rust templates. - [RustQ.Splice](RustQ.Splice.md): Helpers for composing RustQ splice replacements as plain keyword lists. - [RustQ.Template](RustQ.Template.md): Parsed Rust template plus pending substitutions. - Diagnostics and tooling - [RustQ.Diagnostic](RustQ.Diagnostic.md): Structured RustQ diagnostic data for lowering/rendering failures. - [RustQ.Diagnostic.Error](RustQ.Diagnostic.Error.md): Exception wrapper carrying a structured `RustQ.Diagnostic` value. - [RustQ.Error](RustQ.Error.md): Exception raised by bang-style RustQ parsing and rendering APIs. - [RustQ.Reach](RustQ.Reach.md): Reach plugin for RustQ dogfooding rules. - [RustQ.Reach.Smells.BlocklessDefrustmod](RustQ.Reach.Smells.BlocklessDefrustmod.md): Reach smell check flagging a `defrustmod` without a `do` block, which mirrors an external Rust module; remote types and calls, or a block-form `defrustmod` for a RustQ-owned module, say the same thing directly. - [RustQ.Reach.Smells.DefrustMissingSpec](RustQ.Reach.Smells.DefrustMissingSpec.md): Reach smell check flagging a `defrust` without a `@spec`, which RustQ needs for the Rust signature, typed lowering, and inference. - [RustQ.Reach.Smells.DynamicRawRustEscape](RustQ.Reach.Smells.DynamicRawRustEscape.md): Reach smell check flagging a raw Rust escape (`raw_expr!`, `raw_pat!`, `raw_stmt!`, `raw_arm!`, or an AST `raw`, `escape_expr`, or `macro_item`) built from a non-literal value, which the parser cannot validate where it is written. - [RustQ.Reach.Smells.LowLevelControlFlow](RustQ.Reach.Smells.LowLevelControlFlow.md): Reach smell check flagging `return!`, `break`, or `continue` in a `defrust` body, where ordinary Rusty-Elixir control flow usually says the same thing. - [RustQ.Reach.Smells.RawRustEscape](RustQ.Reach.Smells.RawRustEscape.md): Reach smell check flagging a literal raw Rust escape that spans lines or exceeds 100 characters, which `defrust`, RustQ AST builders, metadata, or a small `defrustmacro` usually express. - [RustQ.Reach.Smells.TrivialDefrustWrapper](RustQ.Reach.Smells.TrivialDefrustWrapper.md): Reach smell check flagging a `defrust` that only calls one function and returns `:ok`, a wrapper callable metadata and inference make unnecessary. - Lowering internals - [RustQ.Meta.AST](RustQ.Meta.AST.md): Builds RustQ AST items from `defrust` metadata and explicit quoted bodies. - [RustQ.Meta.Attrs](RustQ.Meta.Attrs.md): The `@cfg`, `@nif`, and `@allow` attributes pending for the next `defrust` or `defnif`, as Rust attributes, and the Rust module and `impl` the definition belongs to. - [RustQ.Meta.Capture](RustQ.Meta.Capture.md): Capture shorthand in Rusty-Elixir, rewritten as the anonymous function it stands for so it lowers wherever a closure does. - [RustQ.Meta.Conditional](RustQ.Meta.Conditional.md): Groups definitions of one function that differ by `@cfg`, so each condition's clauses generate one implementation. Conditional implementations must share a NIF policy. - [RustQ.Meta.Core.Call](RustQ.Meta.Core.Call.md): A call in Rusty-Elixir normalized to its module, function, and arguments, so lowering and typing match `Kernel` operators, local calls, remote calls, and pipes the same way. - [RustQ.Meta.Decoder](RustQ.Meta.Decoder.md): Builds the Rust that decodes BEAM terms into the structs and enums a module's types declare: struct fields, field decoders, and tagged enum decoder bodies. - [RustQ.Meta.Desugar](RustQ.Meta.Desugar.md): Rewrites standard-library calls that are other Rusty-Elixir into that Rusty-Elixir, before `RustQ.Meta.Ownership` and lowering see a body, so lowering keeps to forms Rust has - [RustQ.Meta.Inference](RustQ.Meta.Inference.md): Infers the types of `let` bindings from how a body uses them later: the arguments they are passed as, the struct fields they fill, the methods called on them, and what the body returns. Lowering uses these types where a binding's own expression says too little. - [RustQ.Meta.Lower](RustQ.Meta.Lower.md): Lowers Rusty-Elixir to RustQ AST: expressions, statements, control flow, calls, and closures, with the borrows, `?` propagation, and wrapping their expected types call for. - [RustQ.Meta.Lower.Collection](RustQ.Meta.Lower.Collection.md): Keyed collections, `HashMap`, `BTreeMap`, `HashSet`, and `BTreeSet`, as `RustQ.Meta.Lower.Map` and `RustQ.Meta.Lower.MapSet` lower them. - [RustQ.Meta.Lower.Comprehension](RustQ.Meta.Lower.Comprehension.md): Comprehensions, as values and as loops. - [RustQ.Meta.Lower.Enum](RustQ.Meta.Lower.Enum.md): Lowers `Enum` functions over lists as iterator chains: mapping, filtering, reducing, searching, sorting, and zipping for `RustQ.Meta.Lower.Stdlib`, and types such calls. - [RustQ.Meta.Lower.Env](RustQ.Meta.Lower.Env.md): What lowering knows at a point in a body. `scope_return_type` is what the enclosing function or closure returns, which `?` exits into; `return_type` is what the block being lowered must produce. `captured` names the variables enclosing closures capture, which a closure called once per item must not move. - [RustQ.Meta.Lower.Kernel](RustQ.Meta.Lower.Kernel.md): Lowers `Kernel` operators and functions such as `elem/2`, `put_elem/3`, `abs/1`, and `is_nil/1` for `RustQ.Meta.Lower.Stdlib`, and types such calls. - [RustQ.Meta.Lower.List](RustQ.Meta.Lower.List.md): Lowers `List.duplicate/2`, `List.flatten/1`, and `List.wrap/1` for `RustQ.Meta.Lower.Stdlib`, and types such calls. - [RustQ.Meta.Lower.Map](RustQ.Meta.Lower.Map.md): Lowers `Map` functions for `RustQ.Meta.Lower.Stdlib`, and types such calls. - [RustQ.Meta.Lower.MapSet](RustQ.Meta.Lower.MapSet.md): Lowers `MapSet` functions on a `HashSet` or `BTreeSet` for `RustQ.Meta.Lower.Stdlib`, and types such calls: `new/0` (`new/1,2` are comprehensions; see `RustQ.Meta.Desugar`), `put`, `delete`, `member?`, `union`, `difference`, `intersection`, `subset?`, `disjoint?`, `size`, and `to_list`. An update takes the set only at its last use; see `RustQ.Meta.Lower.Collection`. - [RustQ.Meta.Lower.Mutability](RustQ.Meta.Lower.Mutability.md): Which variables lowered Rust changes, so their bindings are `mut`: a `let` whose value a later statement changes in place, a closure argument its body changes, and an owned argument a rebinding updates in place, as `scores = Map.put(scores, name, 1)` becomes `scores.insert(name, 1);`. - [RustQ.Meta.Lower.Paths](RustQ.Meta.Lower.Paths.md): The Rust paths Elixir aliases name, and the callables a path or a receiver's type reaches. - [RustQ.Meta.Lower.Pattern](RustQ.Meta.Lower.Pattern.md): Elixir patterns as Rust patterns: in `case` clauses, `with` clauses, bindings, closure arguments, and comprehension generators. - [RustQ.Meta.Lower.Range](RustQ.Meta.Lower.Range.md): Lowers ranges and `in` over them for `RustQ.Meta.Lower.Stdlib`, and types such calls. - [RustQ.Meta.Lower.Stdlib](RustQ.Meta.Lower.Stdlib.md): Lowers calls to Elixir's standard library to Rust that keeps their semantics: a call to an Elixir module goes to the module lowering it, named after it (`RustQ.Meta.Lower.Enum` for `Enum`), which implements `RustQ.Meta.Lower.Stdlib.Lowering`. Calls whose semantics Rust cannot preserve are rejected. - [RustQ.Meta.Lower.Stdlib.Lowering](RustQ.Meta.Lower.Stdlib.Lowering.md): The behaviour of a module lowering one Elixir standard-library module, and the helpers such a module lowers and types its arguments with. - [RustQ.Meta.Lower.Stdlib.Lowering.Context](RustQ.Meta.Lower.Stdlib.Lowering.Context.md): What a standard-library lowering knows: the lowering environment of the call, and the type the call is expected to produce. - [RustQ.Meta.Lower.Stdlib.Lowering.TypeContext](RustQ.Meta.Lower.Stdlib.Lowering.TypeContext.md): What a standard-library lowering knows when it types a call. - [RustQ.Meta.Lower.String](RustQ.Meta.Lower.String.md): Lowers `String` functions whose Rust counterparts keep their semantics, such as `String.replace/3` and `String.trim/1` for `RustQ.Meta.Lower.Stdlib`, and types such calls. - [RustQ.Meta.Lower.Tuple](RustQ.Meta.Lower.Tuple.md): Lowers `Tuple.to_list/1` for `RustQ.Meta.Lower.Stdlib`, and types such calls. - [RustQ.Meta.Options](RustQ.Meta.Options.md): The options `use RustQ.Meta` accepts: `:rust_sources`, `:provides`, `:rust_packages`, `:callable_modules`, and `:static_types`. - [RustQ.Meta.Ownership](RustQ.Meta.Ownership.md): Which uses of a variable in a Rusty-Elixir body are its last, so lowering knows where Rust may take a value and where it must borrow or copy one. - [RustQ.Meta.Pattern](RustQ.Meta.Pattern.md): Helpers for reading quoted Elixir patterns, such as the elements of a tuple pattern of any size. - [RustQ.Meta.RustMacro](RustQ.Meta.RustMacro.md): `defrustmacro`: a small Rust `macro_rules!` helper written in Rusty-Elixir. Collects a module's definitions, lowers each body to a macro item, and builds calls to it. - [RustQ.Meta.RustMacro.Definition](RustQ.Meta.RustMacro.Definition.md): A `defrustmacro` as written: its name, its fragment arguments (`:expr`, `:ty`, `:ident`, `:literal`, labeled or repeated), and the Rust module it belongs to. - [RustQ.Meta.RustMacro.Item](RustQ.Meta.RustMacro.Item.md): A lowered `defrustmacro`: the `macro_rules!` item and its Rust module. - [RustQ.Meta.Semantics](RustQ.Meta.Semantics.md): Argument types std methods take that their signatures alone do not say, as `binary_search_by_key` borrowing the key its closure reads. - [RustQ.Meta.StandardPointer](RustQ.Meta.StandardPointer.md): Sees through std's smart pointers: the type a method call on `&T`, `Arc`, `Box`, or a `MutexGuard` reaches, and the guard `Mutex::lock` returns. Only fully qualified std types count, so a user-defined `Arc` or `Mutex` keeps its own semantics. - [RustQ.Meta.StdMethods](RustQ.Meta.StdMethods.md): Which Rust std methods mutate their receiver, return an iterator or an option, or belong to `Option`, `Result`, or std collections, as lowering needs to know. Derived from the Rust 1.98.1 standard library's source by the `rustq.std` Mix task. - [RustQ.Meta.Type](RustQ.Meta.Type.md): Structural metadata for an Elixir typespec lowered by RustQ. - [RustQ.Meta.Typing](RustQ.Meta.Typing.md): Synthesizes the type of a Rusty-Elixir expression and checks one against an expected type, deciding the coercion lowering applies: propagating with `?`, wrapping in `Some`, borrowing, dereferencing, or none. - [RustQ.Meta.Typing.Check](RustQ.Meta.Typing.Check.md): The result of checking an expression against an expected type: its type, when known, and the coercion that makes it fit, or `:unknown`. - [RustQ.Meta.Typing.Env](RustQ.Meta.Typing.Env.md): What typing knows: variable types, callables, Rust module aliases, and type aliases. - [RustQ.Meta.Validate](RustQ.Meta.Validate.md): Checks that a generated item is valid Rust by rendering it and parsing the result with syn, raising when it does not parse. - Code generation internals - [RustQ.Codegen](RustQ.Codegen.md): Generates `native/rustq_nif/src/generated_ast.rs`, the native support RustQ compiles itself against: the `syn` term decoders and dispatch for RustQ AST nodes, written with RustQ's own AST builders and Rusty-Elixir. `rustq.exs` declares the target. - [RustQ.Codegen.DecoderHelpers](RustQ.Codegen.DecoderHelpers.md): Rusty-Elixir helpers the generated AST decoders share, such as decoding lists of items, statements, and arms from terms. Compiled to Rust in `generated_ast.rs`. - [RustQ.Codegen.Decoders](RustQ.Codegen.Decoders.md): Collects the generated `syn` decoders for each RustQ AST category (items, types, patterns, statements, expressions, and match arms) into one list of Rust items. - [RustQ.Codegen.Decoders.Arm](RustQ.Codegen.Decoders.Arm.md): Rusty-Elixir decoders from RustQ AST terms to `syn` match arms, compiled into `generated_ast.rs` for the native renderer. - [RustQ.Codegen.Decoders.Expr](RustQ.Codegen.Decoders.Expr.md): Rusty-Elixir decoders from RustQ AST terms to `syn` expressions, compiled into `generated_ast.rs` for the native renderer. - [RustQ.Codegen.Decoders.Item](RustQ.Codegen.Decoders.Item.md): Rusty-Elixir decoders from RustQ AST terms to `syn` items, compiled into `generated_ast.rs` for the native renderer. - [RustQ.Codegen.Decoders.Pat](RustQ.Codegen.Decoders.Pat.md): Rusty-Elixir decoders from RustQ AST terms to `syn` patterns, compiled into `generated_ast.rs` for the native renderer. - [RustQ.Codegen.Decoders.Stmt](RustQ.Codegen.Decoders.Stmt.md): Rusty-Elixir decoders from RustQ AST terms to `syn` statements, compiled into `generated_ast.rs` for the native renderer. - [RustQ.Codegen.Decoders.Type](RustQ.Codegen.Decoders.Type.md): Rusty-Elixir decoders from RustQ AST terms to `syn` types, compiled into `generated_ast.rs` for the native renderer. - [RustQ.Codegen.DefrustModule](RustQ.Codegen.DefrustModule.md): `use RustQ.Codegen.DefrustModule` sets up a `RustQ.Meta` module for RustQ's own generated native support: it reads callable metadata from the native crate's sources, requires the given `callable_modules`, and defines `asts/0` returning the module's functions as crate-visible Rust items. - [RustQ.Codegen.Dispatch](RustQ.Codegen.Dispatch.md): Builds the Rust functions that dispatch a RustQ AST term to the decoder for its node, one per category, from `RustQ.Rust.AST.Schema`. - [RustQ.Codegen.Helpers](RustQ.Codegen.Helpers.md): Rusty-Elixir helpers for reading fields and values out of RustQ AST terms, which the generated decoders call. Compiled to Rust in `generated_ast.rs`. - [RustQ.Codegen.ModuleHelpers](RustQ.Codegen.ModuleHelpers.md): Rusty-Elixir helpers for the generated AST modules, such as `atom/2`, which makes the atom naming a RustQ AST node module. Compiled to Rust in `generated_ast.rs`. - [RustQ.Codegen.Modules](RustQ.Codegen.Modules.md): Builds the `atoms` and AST-module constant modules of `generated_ast.rs`, naming each RustQ AST node's Elixir module so native code can tell node terms apart. - [RustQ.Rust.AST.NodeDSL](RustQ.Rust.AST.NodeDSL.md): `defnode/4` declares a RustQ AST node module: its struct, typespec, and the category (`:item`, `:stmt`, `:expr`, `:pat`, `:type`, …) that `RustQ.Rust.AST.Schema` and rendering dispatch on. - [RustQ.Rust.AST.Render](RustQ.Rust.AST.Render.md): Renders RustQ AST nodes to Rust source. Items, functions, and expressions with a native shape go through the NIF and `prettyplease`; macro items and other nodes syn cannot represent are rendered here as text. `RustQ.Rust` is the public entry point. - [RustQ.Rust.AST.Schema](RustQ.Rust.AST.Schema.md): Describes every RustQ AST node: its category, fields, and the Rust constant and module names the generated native decoders use for it. RustQ's self-hosted code generation reads it to build `generated_ast.rs`. - [RustQ.Rust.AST.Schema.Node](RustQ.Rust.AST.Schema.Node.md): One RustQ AST node's description: its name, Elixir module, category, fields, and the Rust constant and module that identify it natively. - Native and Rustler internals - [RustQ.Native.ABI](RustQ.Native.ABI.md): Prepares a native module's items for the NIF boundary: `#[rustler::nif]` functions returning a `Result` get a codec wrapper, map structs and resources get their Rustler derives and implementations, and generated code gets the Clippy allows it needs. - [RustQ.Native.Build](RustQ.Native.Build.md): Builds a `RustQ.Native` module's crate: writes its `Cargo.toml` and `src/lib.rs` under the Mix build directory, formats and compiles it with Cargo, installs the library into the application's `priv/native`, and generates the NIF loader. - [RustQ.Native.Manifest](RustQ.Native.Manifest.md): Renders the `Cargo.toml` of a crate `RustQ.Native` generates: a `cdylib` depending on Rustler and the crates the module lists in `:crates`. - [RustQ.Native.Nif](RustQ.Native.Nif.md): Loads RustQ's own native library, `rustq_nif`, which parses, renders, and inspects Rust with `syn` and `prettyplease`. Each function is replaced by its NIF when the library loads. - [RustQ.Native.Options](RustQ.Native.Options.md): Validates and defaults the options `use RustQ.Native` takes on top of `RustQ.Meta`'s: `:otp_app`, `:crate`, `:mode`, `:cargo`, `:crates`, `:build`, and `:load`. - [RustQ.Rustler.HelperSelection](RustQ.Rustler.HelperSelection.md): Selects which generated helpers a Rustler helper generator emits, from its `:include` and `:exclude` options. - [RustQ.Rustler.Nif](RustQ.Rustler.Nif.md): Generates Rustler NIF wrappers, stubs, `NifStruct` declarations, and raw `NIF_TERM` builders. - [RustQ.Rustler.SourceEncoder](RustQ.Rustler.SourceEncoder.md): Builds `Term` encoder functions for Rust structs and enums read from source through `RustQ.Syn`, and the atoms they use. See `RustQ.Rustler.Term.encoders_from_source/3`. - [RustQ.Rustler.SourceEncoder.Plan](RustQ.Rustler.SourceEncoder.Plan.md): The types reachable from the requested roots, by name, in the order their encoders are generated, with the encoder configuration. - Tooling internals - [RustQ.Clippy](RustQ.Clippy.md): Paths of Clippy lints, for `#[allow(...)]` attributes on generated Rust. - [RustQ.Config.State](RustQ.Config.State.md): Process-local state `RustQ.Config` macros fill while `rustq.exs` is evaluated: the generated targets declared so far and the one being built. `manifest/0` returns them in the shape `RustQ.Generated` reads. - [RustQ.Corpus](RustQ.Corpus.md): The golden lowering corpus under `test/corpus`: each `.exs` case defines `RustQ.Meta` modules whose rendered Rust is checked against the `.rs` file beside it. Backs the `rustq.corpus` Mix task, which checks, updates, and reports coverage of the cases. - [RustQ.SourceFingerprint](RustQ.SourceFingerprint.md): Content fingerprints of source files, so cached metadata read from them can tell when a file changed or disappeared. - [RustQ.Syn.Doc](RustQ.Syn.Doc.md): Turns Rust doc comments read by `RustQ.Syn` into Markdown for Elixir docs. ## Mix Tasks - [mix rustq.corpus](Mix.Tasks.Rustq.Corpus.md): Checks or updates the RustQ golden lowering corpus. - [mix rustq.gen](Mix.Tasks.Rustq.Gen.md): Generates files declared in `rustq.exs`. - [mix rustq.templates.check](Mix.Tasks.Rustq.Templates.Check.md): Verifies that RustQ template fixtures still compile against the generated Rust support code.