Expand description
Emitting the crate::ir as formatted Rust source.
Items are built as a proc_macro2::TokenStream with quote!, parsed into
a syn::File (which guarantees the output is syntactically valid Rust),
and pretty-printed with prettyplease.
Structs§
- Prelude
Type Name - A Rust prelude type that the emitted file names without a path, and what needs it.
- Reserved
Type Name - A fixed type name the generator emits at the crate root for a given target, which a component-schema model must not collide with.
- Targets
- Which generator interfaces to emit alongside the shared per-operation types.
Constants§
- HEADER
- Header prepended to every generated file: the do-not-edit marker, then a blanket clippy allowance.
Traits§
- Client
Emitter - Emits a client for a lowered
Serviceas top-level token items. - Server
Emitter - Emits a server interface for a lowered
Serviceas top-level token items.
Functions§
- emit_
flat - Render a module as a flat file: the shared component models and per-operation types at the crate root, followed by the requested generator interfaces.
- emit_
module - Render a module of IR items into formatted Rust source.
- prelude_
type_ names - The prelude types the requested
targetsname without a path. - reserved_
type_ names - The crate-root type names the requested
targetsemit. A component schema whose generated name matches one of these will produce a duplicate item, socrate::lower::check_type_name_collisionsrejects it up front.