Skip to content

Commit be97266

Browse files
committed
Remove mention of LambdaCodableAdapter being a class and update code blocks
1 parent 4eea6ec commit be97266

File tree

1 file changed

+7
-7
lines changed
  • Sources/AWSLambdaRuntimeCore/Documentation.docc/Proposals

1 file changed

+7
-7
lines changed

Sources/AWSLambdaRuntimeCore/Documentation.docc/Proposals/0001-v2-api.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@ try await serviceGroup.run()
164164

165165
A detailed explanation is provided in the **Codable Support** section. In short, much of the boilerplate code defined for
166166
each handler protocol in `Lambda+Codable` and `Lambda+String` will be replaced with a single `LambdaCodableAdapter`
167-
class.
167+
struct.
168168

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
170170
output types, and (3) any decoder and encoder conforming to `LambdaEventDecoder` and `LambdaOutputDecoder`. The adapter
171171
will wrap the underlying handler with encoding/decoding logic.
172172

@@ -424,14 +424,14 @@ public protocol LambdaHandler {
424424

425425
```swift
426426
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
428428
/// 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
430430
}
431431

432432
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
435435
}
436436
```
437437

@@ -498,7 +498,7 @@ or `Void`.
498498
```swift
499499
public struct ClosureHandler<Event, Output>: LambdaHandler {
500500
/// 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
502502
/// Initialize with a closure handler over a generic Input type (Void Output).
503503
public init(body: @escaping (Event, LambdaContext) async throws -> Void) where Output == Void
504504
/// The business logic of the Lambda function.

0 commit comments

Comments
 (0)