Skip to main content

Module codegen

Module codegen 

Source
Expand description

Code generation layer — converts parsed AST into proc_macro2::TokenStream.

Each sub-module corresponds to one proc macro in rorpc-macros. rorpc-macros/src/lib.rs calls these functions directly; the only logic that lives there is the thin proc_macro::TokenStreamproc_macro2::TokenStream conversion.

Re-exports§

pub use contract_attr::ContractArgs;
pub use contract_attr::expand_contract;
pub use error_derive::expand_orpc_errors;
pub use namespace::NamespaceArgs;
pub use namespace::expand_namespace;
pub use orpc::MethodShorthandArgs;
pub use orpc::OrpcArgs;
pub use orpc::expand_orpc;
pub use router::RouterArgs;
pub use router::expand_router;
pub use zod_ts::derive_zod_ts;
pub use zod_ts::base_type_name;
pub use zod_ts::rust_type_to_ts_schema;
pub use zod_ts::to_schema_name;

Modules§

contract_attr
Code generation for the #[contract] attribute macro.
error_derive
Code generation for #[derive(OrpcError)].
namespace
Code generation for the #[rorpc::namespace("/prefix")] attribute macro.
orpc
Code generation for the #[rorpc(method, path)] attribute macro.
router
Code generation for the router!(...) proc macro.
zod_ts
Code generation for #[derive(ZodTs)].