Code generation
workspace -> Cargo packagesRust project
Rust generation creates a Cargo workspace whose services and contracts also build independently.
When to use
Use this reference when generating, reviewing or operating a Service Architect project.
Behavior
- Each service and referenced Module has its own Cargo.toml.
- src/main.rs starts the service and src/lib.rs exposes package code.
- src/internal/app contains generated ServiceLib graph wiring.
- src/internal/functions contains business implementations and tests.
- Public types are emitted below <Module.name>/src/types when Type.module selects that Module.
- Modules selected by HTTP connectors include generate-openapi.generated.sh and generated transport modules.
Rust service directories
Important paths in each generated Rust service.
PathOwnershipDescription
Cargo.tomlManagedStandalone crate metadata and locked dependencies.
src/main.rsPreserved entrypointStarts the service executable.
src/lib.rsManagedExports the service crate.
src/internal/app/GeneratedRuntime graph and transport assembly.
src/internal/functions/PreservedBusiness stream functions and endpoint handlers.
src/internal/config/MixedGenerated configuration model and extensions.
src/internal/types/MixedService-local Rust contracts.
generate-openapi.generated.shGenerated when neededPinned OpenAPI transport binding generation.
Rust service tree
<service-name>/
Cargo.toml
src/main.rs + src/lib.rs
src/internal/app/
src/internal/functions/
src/internal/config/ + types/
config/ + graph/ + docs/
grafana/ + helm/