-{"metadata":{"externalID":"s:20AWSLambdaRuntimeCore14ClosureHandlerV4bodyACyxq_Gq_x_AA13LambdaContextVtYaKc_tcSER_rlufc","title":"init(body:)","fragments":[{"text":"init","kind":"identifier"},{"text":"(","kind":"text"},{"kind":"externalParam","text":"body"},{"kind":"text","text":": ("},{"text":"Event","kind":"typeIdentifier"},{"text":", ","kind":"text"},{"preciseIdentifier":"s:20AWSLambdaRuntimeCore13LambdaContextV","kind":"typeIdentifier","text":"LambdaContext"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"kind":"keyword","text":"throws"},{"text":" -> ","kind":"text"},{"kind":"typeIdentifier","text":"Output"},{"text":")","kind":"text"}],"modules":[{"name":"AWSLambdaRuntimeCore"}],"role":"symbol","roleHeading":"Initializer","symbolKind":"init"},"sections":[],"variants":[{"paths":["\/documentation\/awslambdaruntimecore\/closurehandler\/init(body:)-5sz8r"],"traits":[{"interfaceLanguage":"swift"}]}],"abstract":[{"text":"Initialize with a closure handler over generic ","type":"text"},{"code":"Input","type":"codeVoice"},{"text":" and ","type":"text"},{"type":"codeVoice","code":"Output"},{"type":"text","text":" types."}],"primaryContentSections":[{"kind":"declarations","declarations":[{"platforms":["macOS"],"languages":["swift"],"tokens":[{"kind":"keyword","text":"init"},{"kind":"text","text":"("},{"kind":"externalParam","text":"body"},{"text":": ","kind":"text"},{"text":"@escaping","kind":"keyword"},{"text":" (","kind":"text"},{"kind":"typeIdentifier","text":"Event"},{"text":", ","kind":"text"},{"kind":"typeIdentifier","preciseIdentifier":"s:20AWSLambdaRuntimeCore13LambdaContextV","identifier":"doc:\/\/AWSLambdaRuntimeCore\/documentation\/AWSLambdaRuntimeCore\/LambdaContext","text":"LambdaContext"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"kind":"keyword","text":"throws"},{"kind":"text","text":" -> "},{"kind":"typeIdentifier","text":"Output"},{"text":") ","kind":"text"},{"kind":"keyword","text":"where"},{"text":" ","kind":"text"},{"kind":"typeIdentifier","text":"Output"},{"kind":"text","text":" : "},{"preciseIdentifier":"s:SE","text":"Encodable","kind":"typeIdentifier"}]}]},{"kind":"parameters","parameters":[{"name":"body","content":[{"type":"paragraph","inlineContent":[{"text":"The handler function written as a closure.","type":"text"}]}]}]}],"schemaVersion":{"major":0,"patch":0,"minor":3},"hierarchy":{"paths":[["doc:\/\/AWSLambdaRuntimeCore\/documentation\/AWSLambdaRuntimeCore","doc:\/\/AWSLambdaRuntimeCore\/documentation\/AWSLambdaRuntimeCore\/ClosureHandler"]]},"kind":"symbol","identifier":{"url":"doc:\/\/AWSLambdaRuntimeCore\/documentation\/AWSLambdaRuntimeCore\/ClosureHandler\/init(body:)-5sz8r","interfaceLanguage":"swift"},"references":{"doc://AWSLambdaRuntimeCore/documentation/AWSLambdaRuntimeCore/LambdaContext":{"kind":"symbol","type":"topic","title":"LambdaContext","fragments":[{"text":"struct","kind":"keyword"},{"kind":"text","text":" "},{"text":"LambdaContext","kind":"identifier"}],"abstract":[{"type":"text","text":"Lambda runtime context."},{"type":"text","text":" "},{"text":"The Lambda runtime generates and passes the ","type":"text"},{"type":"codeVoice","code":"LambdaContext"},{"text":" to the Lambda handler as an argument.","type":"text"}],"identifier":"doc:\/\/AWSLambdaRuntimeCore\/documentation\/AWSLambdaRuntimeCore\/LambdaContext","url":"\/documentation\/awslambdaruntimecore\/lambdacontext","role":"symbol","navigatorTitle":[{"text":"LambdaContext","kind":"identifier"}]},"doc://AWSLambdaRuntimeCore/documentation/AWSLambdaRuntimeCore/ClosureHandler/init(body:)-5sz8r":{"kind":"symbol","abstract":[{"text":"Initialize with a closure handler over generic ","type":"text"},{"type":"codeVoice","code":"Input"},{"text":" and ","type":"text"},{"type":"codeVoice","code":"Output"},{"text":" types.","type":"text"}],"type":"topic","fragments":[{"text":"init","kind":"identifier"},{"kind":"text","text":"("},{"kind":"externalParam","text":"body"},{"text":": (","kind":"text"},{"text":"Event","kind":"typeIdentifier"},{"text":", ","kind":"text"},{"preciseIdentifier":"s:20AWSLambdaRuntimeCore13LambdaContextV","kind":"typeIdentifier","text":"LambdaContext"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"kind":"text","text":" "},{"text":"throws","kind":"keyword"},{"kind":"text","text":" -> "},{"text":"Output","kind":"typeIdentifier"},{"kind":"text","text":")"}],"identifier":"doc:\/\/AWSLambdaRuntimeCore\/documentation\/AWSLambdaRuntimeCore\/ClosureHandler\/init(body:)-5sz8r","url":"\/documentation\/awslambdaruntimecore\/closurehandler\/init(body:)-5sz8r","title":"init(body:)","role":"symbol"},"doc://AWSLambdaRuntimeCore/documentation/AWSLambdaRuntimeCore/LambdaHandler":{"type":"topic","title":"LambdaHandler","navigatorTitle":[{"kind":"identifier","text":"LambdaHandler"}],"identifier":"doc:\/\/AWSLambdaRuntimeCore\/documentation\/AWSLambdaRuntimeCore\/LambdaHandler","fragments":[{"kind":"keyword","text":"protocol"},{"kind":"text","text":" "},{"text":"LambdaHandler","kind":"identifier"}],"abstract":[{"text":"This handler protocol is intended to serve the most common use-cases.","type":"text"},{"text":" ","type":"text"},{"text":"This protocol is completely agnostic to any encoding\/decoding – decoding the received event invocation into an ","type":"text"},{"identifier":"doc:\/\/AWSLambdaRuntimeCore\/documentation\/AWSLambdaRuntimeCore\/LambdaHandler\/Event","isActive":true,"type":"reference"},{"type":"text","text":" object and encoding the returned "},{"type":"reference","isActive":true,"identifier":"doc:\/\/AWSLambdaRuntimeCore\/documentation\/AWSLambdaRuntimeCore\/LambdaHandler\/Output"},{"text":" object is handled by the library.","type":"text"},{"type":"text","text":" "},{"text":"The","type":"text"},{"isActive":true,"type":"reference","identifier":"doc:\/\/AWSLambdaRuntimeCore\/documentation\/AWSLambdaRuntimeCore\/LambdaHandler\/handle(_:context:)"},{"text":" function simply receives the generic ","type":"text"},{"type":"reference","identifier":"doc:\/\/AWSLambdaRuntimeCore\/documentation\/AWSLambdaRuntimeCore\/LambdaHandler\/Event","isActive":true},{"text":" object as input and returns the generic ","type":"text"},{"identifier":"doc:\/\/AWSLambdaRuntimeCore\/documentation\/AWSLambdaRuntimeCore\/LambdaHandler\/Output","type":"reference","isActive":true},{"type":"text","text":" object."}],"kind":"symbol","role":"symbol","url":"\/documentation\/awslambdaruntimecore\/lambdahandler"},"doc://AWSLambdaRuntimeCore/documentation/AWSLambdaRuntimeCore":{"url":"\/documentation\/awslambdaruntimecore","kind":"symbol","role":"collection","title":"AWSLambdaRuntimeCore","identifier":"doc:\/\/AWSLambdaRuntimeCore\/documentation\/AWSLambdaRuntimeCore","type":"topic","abstract":[{"type":"text","text":"An AWS Lambda runtime for the Swift programming language"}]},"doc://AWSLambdaRuntimeCore/documentation/AWSLambdaRuntimeCore/ClosureHandler":{"fragments":[{"text":"struct","kind":"keyword"},{"kind":"text","text":" "},{"text":"ClosureHandler","kind":"identifier"}],"abstract":[{"type":"text","text":"A "},{"identifier":"doc:\/\/AWSLambdaRuntimeCore\/documentation\/AWSLambdaRuntimeCore\/LambdaHandler","isActive":true,"type":"reference"},{"type":"text","text":" conforming handler object that can be constructed with a closure."},{"type":"text","text":" "},{"type":"text","text":"Allows for a handler to be defined in a clean manner, leveraging Swift’s trailing closure syntax."}],"identifier":"doc:\/\/AWSLambdaRuntimeCore\/documentation\/AWSLambdaRuntimeCore\/ClosureHandler","url":"\/documentation\/awslambdaruntimecore\/closurehandler","title":"ClosureHandler","role":"symbol","navigatorTitle":[{"kind":"identifier","text":"ClosureHandler"}],"type":"topic","kind":"symbol"}}}
0 commit comments