@@ -164,9 +164,9 @@ try await serviceGroup.run()
164
164
165
165
A detailed explanation is provided in the ** Codable Support** section. In short, much of the boilerplate code defined for
166
166
each handler protocol in ` Lambda+Codable ` and ` Lambda+String ` will be replaced with a single ` LambdaCodableAdapter `
167
- class .
167
+ struct .
168
168
169
- This adapter class is generic over (1) any handler conforming to ` LambdaHandler ` , (2) the user-specified input and
169
+ This adapter struct is generic over (1) any handler conforming to ` LambdaHandler ` , (2) the user-specified input and
170
170
output types, and (3) any decoder and encoder conforming to ` LambdaEventDecoder ` and ` LambdaOutputDecoder ` . The adapter
171
171
will wrap the underlying handler with encoding/decoding logic.
172
172
@@ -424,14 +424,14 @@ public protocol LambdaHandler {
424
424
425
425
``` swift
426
426
public protocol LambdaEventDecoder {
427
- /// Decode the ByteBuffer representing the received event into the generic type T
427
+ /// Decode the ByteBuffer representing the received event into the generic type Event
428
428
/// the handler will receive
429
- func decode <T : Decodable >(_ type : T .Type , from buffer : ByteBuffer) throws -> T
429
+ func decode <Event : Decodable >(_ type : Event .Type , from buffer : ByteBuffer) throws -> Event
430
430
}
431
431
432
432
public protocol LambdaOutputEncoder {
433
- /// Encode the generic type T the handler has produced into a ByteBuffer
434
- func encode <T : Encodable >(_ value : T , into buffer : inout ByteBuffer) throws
433
+ /// Encode the generic type Output the handler has produced into a ByteBuffer
434
+ func encode <Output : Encodable >(_ value : Output , into buffer : inout ByteBuffer) throws
435
435
}
436
436
```
437
437
@@ -498,7 +498,7 @@ or `Void`.
498
498
``` swift
499
499
public struct ClosureHandler <Event , Output >: LambdaHandler {
500
500
/// Initialize with a closure handler over generic Input and Output types
501
- public init (body : @escaping (Event, LambdaContext) async throws -> Output) where Output: Encoda
501
+ public init (body : @escaping (Event, LambdaContext) async throws -> Output) where Output: Encodable
502
502
/// Initialize with a closure handler over a generic Input type (Void Output).
503
503
public init (body : @escaping (Event, LambdaContext) async throws -> Void ) where Output == Void
504
504
/// The business logic of the Lambda function.
0 commit comments