Library guide · API index and notation
This page is generated from the bundled library in this checkout. Signatures and adjacent source comments are reproduced below; the linked guide explains usage, storage, failures, and platform support.
import "std/web/application"
Names used in signatures
Unqualified names denote this package’s types (including other source files in the same package), language built-ins, or generic parameters such as T. Qualified names use the import aliases below. These aliases belong to the library source; import a dependency yourself to use its alias in your program.
| Alias | Package | Source file |
|---|---|---|
io |
std/io |
application.dodo |
testing |
std/web/testing |
application.dodo |
web |
std/web |
application.dodo |
ROUTE_CAPACITY
Constant · Source
Fixed registration storage. Handler values are owned inline in a typed chain.
pub const ROUTE_CAPACITY: usize = 8
Table
Struct · Source
pub struct Table {
// Private implementation fields omitted.
}
Table.routes
Function · Source
pub fn routes(&self) -> &[web.Route]
Table.router
Function · Source
pub fn router(&self) -> web.Router from(self)
Empty
Struct · Source
pub struct Empty {
}
Empty.handle
Function · Source
pub fn handle(&mut self, request: &mut web.Request, response: &mut web.Response) -> void!web.Failure
Handlers
Struct · Source
pub struct Handlers<A, H> {
// Private implementation fields omitted.
}
Handlers.handle
Function · Source
pub fn handle(&mut self, request: &mut web.Request, response: &mut web.Response) -> void!web.Failure
Application
Struct · Source
pub struct Application<H> {
pub table: Table
pub handler: H
}
Application.route
Function · Source
Registration consumes the previous application because each handler can have a different type. No function values, erasure, or allocation.
pub fn route<N>(self, method: &[u8], pattern: &[u8], handler: N) -> Application<Handlers<H, N>>!web.Error from(self, method, pattern, handler)
Application.get
Function · Source
pub fn get<N>(self, pattern: &[u8], handler: N) -> Application<Handlers<H, N>>!web.Error from(self, pattern, handler)
Application.post
Function · Source
pub fn post<N>(self, pattern: &[u8], handler: N) -> Application<Handlers<H, N>>!web.Error from(self, pattern, handler)
Application.request
Function · Source
pub fn request(&mut self, method: &[u8], target: &[u8]) -> testing.Response
Application.request_with
Function · Source
pub fn request_with(&mut self, input: &testing.Request) -> testing.Response
Application.put
Function · Source
pub fn put<N>(self, pattern: &[u8], handler: N) -> Application<Handlers<H, N>>!web.Error from(self, pattern, handler)
Application.patch
Function · Source
pub fn patch<N>(self, pattern: &[u8], handler: N) -> Application<Handlers<H, N>>!web.Error from(self, pattern, handler)
Application.delete
Function · Source
pub fn delete<N>(self, pattern: &[u8], handler: N) -> Application<Handlers<H, N>>!web.Error from(self, pattern, handler)
Application.head
Function · Source
pub fn head<N>(self, pattern: &[u8], handler: N) -> Application<Handlers<H, N>>!web.Error from(self, pattern, handler)
Application.options
Function · Source
pub fn options<N>(self, pattern: &[u8], handler: N) -> Application<Handlers<H, N>>!web.Error from(self, pattern, handler)
new
Function · Source
pub fn new() -> Application<Empty> from(static)
RegistrationError
Struct · Source
The fluent builder retains the first setup error and validates before use. Borrowed method/pattern bytes remain available in a useful diagnostic.
pub struct RegistrationError {
pub kind: web.Error
pub method: &[u8]
pub pattern: &[u8]
pub index: usize
}
RegistrationError.format
Function · Source
pub fn format<F>(&self, output: &mut F) -> void!io.Error
Builder
Struct · Source
pub struct Builder<H, M> {
// Private implementation fields omitted.
}
Builder.route
Function · Source
pub fn route<N>(self, method: &[u8], pattern: &[u8], handler: N) -> Builder<Handlers<H, N>, M> from(self, method, pattern, handler)
Builder.get
Function · Source
pub fn get<N>(self, pattern: &[u8], handler: N) -> Builder<Handlers<H, N>, M> from(self, pattern, handler)
Builder.post
Function · Source
pub fn post<N>(self, pattern: &[u8], handler: N) -> Builder<Handlers<H, N>, M> from(self, pattern, handler)
Builder.put
Function · Source
pub fn put<N>(self, pattern: &[u8], handler: N) -> Builder<Handlers<H, N>, M> from(self, pattern, handler)
Builder.patch
Function · Source
pub fn patch<N>(self, pattern: &[u8], handler: N) -> Builder<Handlers<H, N>, M> from(self, pattern, handler)
Builder.delete
Function · Source
pub fn delete<N>(self, pattern: &[u8], handler: N) -> Builder<Handlers<H, N>, M> from(self, pattern, handler)
Builder.head
Function · Source
pub fn head<N>(self, pattern: &[u8], handler: N) -> Builder<Handlers<H, N>, M> from(self, pattern, handler)
Builder.options
Function · Source
pub fn options<N>(self, pattern: &[u8], handler: N) -> Builder<Handlers<H, N>, M> from(self, pattern, handler)
Builder.middleware
Function · Source
Middleware applies to all routes regardless of registration order. First registered is outermost: before runs forward, after in reverse.
pub fn middleware<N>(self, middleware: N) -> Builder<H, web.Chain<M, N>> from(self, middleware)
Builder.build
Function · Source
pub fn build(self) -> Application<web.WithMiddleware<H, M>>!RegistrationError from(self)
builder
Function · Source
pub fn builder() -> Builder<Empty, web.NoMiddleware> from(static)