pub struct Request {
pub context: Arc<Context>,
pub stream: TcpStream,
pub method: String,
pub raw_path: String,
pub pathname: String,
pub query_params: QueryParams,
pub headers: Headers,
pub partial_body: Option<Vec<u8>>,
pub body_read: Arc<AtomicBool>,
pub body_parsed: Arc<AtomicBool>,
/* private fields */
}
Fields§
§context: Arc<Context>
§stream: TcpStream
§method: String
§raw_path: String
§pathname: String
§query_params: QueryParams
§headers: Headers
§partial_body: Option<Vec<u8>>
§body_read: Arc<AtomicBool>
It specifies that body has been read already either some part or all. If body read is true, but body parse is false, need to change current connection to “keep-alive: close” It is because parsing body is probably failed.
body_parsed: Arc<AtomicBool>
Implementations§
Source§impl Request
impl Request
pub fn new( context: Arc<Context>, stream: TcpStream, request_method: String, raw_path: String, headers: HashMap<String, Vec<String>>, body_read: Arc<AtomicBool>, body_parsed: Arc<AtomicBool>, ) -> Self
pub fn setup(&mut self)
pub fn set_partial_body_bytes(&mut self, bytes: Vec<u8>)
pub fn should_close_connection(&self) -> bool
pub fn body(&mut self) -> Option<NamedTempFile>
pub fn form_data(&mut self) -> &mut FormData
pub fn files(&mut self) -> &mut FormFiles
pub fn parse_request_body(&mut self)
pub fn multipart_form_data( &mut self, content_type: String, content_length: Option<usize>, limits: Limits, ) -> Result<Vec<FormPart>, MultipartFormDataError>
pub fn parse_url_encoded( &mut self, content_length: usize, limits: Limits, ) -> Result<FormFields, UrlEncodedFormDataError>
pub fn multipart_form_data_and_files( &self, form_parts: Vec<FormPart>, ) -> (FormData, FormFiles)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more