pub trait WebRequest {
// Required methods
fn params(&self) -> &[(String, String)];
fn read_body(&mut self, buf: &mut [u8]) -> usize;
fn send_headers(&mut self, status: u16, headers: &[String]) -> bool;
fn write(&mut self, data: &[u8]) -> bool;
}Expand description
One HTTP request, as PHP sees it.
Required Methods§
Sourcefn params(&self) -> &[(String, String)]
fn params(&self) -> &[(String, String)]
The CGI/1.1 parameters, which become $_SERVER (SCRIPT_FILENAME, REQUEST_METHOD, HTTP_*, …).
Sourcefn read_body(&mut self, buf: &mut [u8]) -> usize
fn read_body(&mut self, buf: &mut [u8]) -> usize
Reads the request body; 0 at its end (or when it cannot be read).
Sourcefn send_headers(&mut self, status: u16, headers: &[String]) -> bool
fn send_headers(&mut self, status: u16, headers: &[String]) -> bool
The response status and header lines (Name: value), once, before any body.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".