[][src]Crate wasm_service

Base support for wasm service using Confluence Workers

Structs

Context

Context manages the information flow for an incoming HTTP Request, the application handler, and the generated HTTP Response. It holds a buffer for log messages, and a hook for deferred tasks to be processed after the Response is returned.

Request

Incoming HTTP request (to Worker).

Response

Worker response for HTTP requests. The Response is created/accessed from ctx.response() and has a builder-like api.

Enums

Error

Errors generated by this crate

Method

HTTP Method

Traits

Handler

Trait that defines app/service's request handler and router

Runnable

Runnable trait for deferred tasks Deferred tasks are often useful for logging and analytics.

Functions

service_request

Entrypoint for wasm-service. Converts parameters from javascript into Request, invokes app-specific handler, and converts Response to javascript. Also sends logs to [Logger] and runs deferred tasks.