spaceship_helm/types
Types
pub type AsyncHandler =
fn(Context) -> promise.Promise(response.Response(BitArray))
pub type AsyncMiddleware =
fn(
Context,
fn(Context) -> promise.Promise(response.Response(BitArray)),
) -> promise.Promise(response.Response(BitArray))
pub type AsyncRoute {
AsyncRoute(
path: List(String),
handler: fn(Context) -> promise.Promise(
response.Response(BitArray),
),
middleware: List(
fn(
Context,
fn(Context) -> promise.Promise(
response.Response(BitArray),
),
) -> promise.Promise(response.Response(BitArray)),
),
)
}
Constructors
-
AsyncRoute( path: List(String), handler: fn(Context) -> promise.Promise( response.Response(BitArray), ), middleware: List( fn( Context, fn(Context) -> promise.Promise(response.Response(BitArray)), ) -> promise.Promise(response.Response(BitArray)), ), )
pub type Context {
Context(
req: request.Request(BitArray),
params: dict.Dict(String, String),
query: dict.Dict(String, String),
extra: dict.Dict(String, dynamic.Dynamic),
)
}
Constructors
-
Context( req: request.Request(BitArray), params: dict.Dict(String, String), query: dict.Dict(String, String), extra: dict.Dict(String, dynamic.Dynamic), )
pub type Handler =
fn(Context) -> response.Response(BitArray)
pub type Middleware =
fn(Context, fn(Context) -> response.Response(BitArray)) -> response.Response(
BitArray,
)
pub type Route {
Route(
path: List(String),
handler: fn(Context) -> response.Response(BitArray),
middleware: List(
fn(Context, fn(Context) -> response.Response(BitArray)) -> response.Response(
BitArray,
),
),
)
}
Constructors
-
Route( path: List(String), handler: fn(Context) -> response.Response(BitArray), middleware: List( fn(Context, fn(Context) -> response.Response(BitArray)) -> response.Response( BitArray, ), ), )