Crate thruster[][src]

Structs

App

App, the main component of Thruster. The App is the entry point for your application and handles all incomming requests. Apps are also composeable, that is, via the subapp method, you can use all of the methods and middlewares contained within an app as a subset of your app's routes.

BasicContext
Http
MiddlewareChain

The MiddlewareChain represents a chain of futures that is every piece of middleware following the current one. If you wish to not continue down the chain, simply do not call chain.next, otherwise, you can call it and wait for the return value of the future and proceed with work accordingly.

Request
Response

Represents an HTTP response

Traits

Context

A Context is what will be passed between functions in the middleware for the defined routes of Thruster. Since a new context is made for each incomming request, it's important to keep this struct lean and quick, as well as the context_generator associated with it.

Functions

file

Type Definitions

Middleware

The Middleware type simply defines the signature of a thruster middleware function. It takes a context of the type of the thruster app, followed by a MiddlewareChain.

MiddlewareReturnValue

MiddlewareReturnValues are the values that Thruster expects middleware to return. It's shorthand for a Future, where the Item is a Context associated with the app, and the error is an io::Error.