-
- Downloads
Add server operation registry and router (#850)
This commit adds two things: 1. A runtime router implementing `tower`'s [`Service`](https://docs.rs/tower-service/0.3.1/tower_service/trait.Service.html) that adheres to [Smithy's `http` trait specification](https://awslabs.github.io/smithy/1.0/spec/core/http-traits.html#http-trait), that is linear in the number of registered routes. 2. A code-generated "operation registry" that allows service implementers to provide Rust functions and declare them as the handlers for their service's operations. The framework will receive HTTP requests from the server and route them to the corresponding operation handler.
Showing
- codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/OperationRegistryGenerator.kt 129 additions, 0 deletions...en/server/smithy/generators/OperationRegistryGenerator.kt
- codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGenerator.kt 5 additions, 1 deletion...odegen/server/smithy/generators/ServerServiceGenerator.kt
- codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/protocols/ServerHttpProtocolGenerator.kt 71 additions, 65 deletions...en/server/smithy/protocols/ServerHttpProtocolGenerator.kt
- codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/rustlang/CargoDependency.kt 1 addition, 1 deletion...re/amazon/smithy/rust/codegen/rustlang/CargoDependency.kt
- codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/rustlang/RustTypes.kt 0 additions, 1 deletion...software/amazon/smithy/rust/codegen/rustlang/RustTypes.kt
- codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/RuntimeTypes.kt 7 additions, 0 deletions...oftware/amazon/smithy/rust/codegen/smithy/RuntimeTypes.kt
- rust-runtime/aws-smithy-http-server/Cargo.toml 9 additions, 1 deletionrust-runtime/aws-smithy-http-server/Cargo.toml
- rust-runtime/aws-smithy-http-server/src/body.rs 4 additions, 0 deletionsrust-runtime/aws-smithy-http-server/src/body.rs
- rust-runtime/aws-smithy-http-server/src/clone_box_service.rs 63 additions, 0 deletionsrust-runtime/aws-smithy-http-server/src/clone_box_service.rs
- rust-runtime/aws-smithy-http-server/src/error.rs 3 additions, 3 deletionsrust-runtime/aws-smithy-http-server/src/error.rs
- rust-runtime/aws-smithy-http-server/src/handler/mod.rs 104 additions, 0 deletionsrust-runtime/aws-smithy-http-server/src/handler/mod.rs
- rust-runtime/aws-smithy-http-server/src/lib.rs 14 additions, 5 deletionsrust-runtime/aws-smithy-http-server/src/lib.rs
- rust-runtime/aws-smithy-http-server/src/macros.rs 46 additions, 0 deletionsrust-runtime/aws-smithy-http-server/src/macros.rs
- rust-runtime/aws-smithy-http-server/src/routing/future.rs 62 additions, 0 deletionsrust-runtime/aws-smithy-http-server/src/routing/future.rs
- rust-runtime/aws-smithy-http-server/src/routing/into_make_service.rs 91 additions, 0 deletions...e/aws-smithy-http-server/src/routing/into_make_service.rs
- rust-runtime/aws-smithy-http-server/src/routing/mod.rs 264 additions, 0 deletionsrust-runtime/aws-smithy-http-server/src/routing/mod.rs
- rust-runtime/aws-smithy-http-server/src/routing/operation_handler.rs 62 additions, 0 deletions...e/aws-smithy-http-server/src/routing/operation_handler.rs
- rust-runtime/aws-smithy-http-server/src/routing/request_spec.rs 265 additions, 0 deletions...untime/aws-smithy-http-server/src/routing/request_spec.rs
- rust-runtime/aws-smithy-http-server/src/routing/route.rs 133 additions, 0 deletionsrust-runtime/aws-smithy-http-server/src/routing/route.rs
- rust-runtime/aws-smithy-http-server/src/test_helpers.rs 2 additions, 0 deletionsrust-runtime/aws-smithy-http-server/src/test_helpers.rs
Loading
Please register or sign in to comment