pub struct Exchange { /* private fields */ }
Expand description
An HTTP message exchange. This is a pair of a request and a response.
Implementations§
Source§impl Exchange
impl Exchange
Sourcepub unsafe fn new(request: *mut FCGX_Request) -> Self
pub unsafe fn new(request: *mut FCGX_Request) -> Self
Create an exchange from a FastCGI request. The exchange will take
ownership of the request, and free it with free
.
You probably want to use accept
instead.
Sourcepub fn accept<L>(listener: &L) -> Result<Self>where
L: AsRawFd,
pub fn accept<L>(listener: &L) -> Result<Self>where
L: AsRawFd,
Accept a request from a listener. This can be a TCP listener or a Unix domain socket listener. Do not pass an already-accepted socket; that will not work.
The reason this method exists, rather than requiring the caller to accept the connection from the listener, is that the C library of the FastCGI SDK does not expose a function that does not itself accept the connection.
Sourcepub fn environment(&self) -> Environment<'_> ⓘ
pub fn environment(&self) -> Environment<'_> ⓘ
Return the FastCGI environment. These include the request method and the request header, and various information about the server.
Sourcepub fn request_body(&self) -> RequestBody<'_> ⓘ
pub fn request_body(&self) -> RequestBody<'_> ⓘ
Return the request body for this exchange. You can call this method multiple times, and all returned writers will write to the same buffer and socket.