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/testing"
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 |
|---|---|---|
bytes |
core/bytes |
testing.dodo |
http |
std/http |
testing.dodo |
web |
std/web |
testing.dodo |
BODY_BYTES
Constant · Source
pub const BODY_BYTES: usize = 4096
HEADER_BYTES
Constant · Source
pub const HEADER_BYTES: usize = 4096
HEADER_FIELDS
Constant · Source
pub const HEADER_FIELDS: usize = 32
Request
Struct · Source
An in-process request. Header values are copied; target and body are borrowed.
pub struct Request {
// Private implementation fields omitted.
}
Request.new
Function · Source
pub fn new(method: &[u8], target: &[u8]) -> Request from(method, target)
Request.body
Function · Source
pub fn body(self, data: &[u8]) -> Request from(self, data)
Request.header
Function · Source
pub fn header(&mut self, name: &[u8], value: &[u8]) -> void!web.Failure
Response
Struct · Source
Owns its bytes, so a response survives the next request and application drop. Failure diagnostics are available to tests but never included in HTTP bodies.
pub struct Response {
pub failure: Option<web.Failure>
// Private implementation fields omitted.
}
Response.expect_status
Function · Source
pub fn expect_status(self, expected: u16) -> Response
Response.expect_body
Function · Source
pub fn expect_body(self, expected: &[u8]) -> Response
Response.expect_header
Function · Source
pub fn expect_header(self, name: &[u8], expected: &[u8]) -> Response
Response.status
Function · Source
pub fn status(&self) -> u16
Response.body
Function · Source
pub fn body(&self) -> &[u8]
Response.header
Function · Source
pub fn header(&self, name: &[u8]) -> Option<&[u8]> from(self)
Response.header_at
Function · Source
pub fn header_at(&self, index: usize) -> Option<http.Header> from(self)
Response.header_next
Function · Source
pub fn header_next(&self, cursor: &mut usize) -> Option<http.Header> from(self)
send
Function · Source
Exercises decoding, routing, middleware, state, and response helpers. It does not simulate the wire parser, transport, timeouts, or custom server limits.
pub fn send<H>(routes: &[web.Route], handler: &mut H, input: &Request) -> Response
send_router
Function · Source
Reuse a previously validated route table for repeated in-process requests.
pub fn send_router<H>(router: &web.Router, handler: &mut H, input: &Request) -> Response