pub struct Request {
pub method: Method,
pub scheme: Option<Scheme>,
pub authority: Option<Authority>,
pub path_with_query: Option<PathAndQuery>,
pub headers: Arc<HeaderMap>,
pub options: Option<Arc<RequestOptions>>,
/* private fields */
}Available on crate feature
p3 only.Expand description
The concrete type behind a wasi:http/types/request resource.
Fields§
§method: MethodThe method of the request.
scheme: Option<Scheme>The scheme of the request.
The authority of the request.
path_with_query: Option<PathAndQuery>The path and query of the request.
headers: Arc<HeaderMap>The request headers.
options: Option<Arc<RequestOptions>>Request options.
Implementations§
Source§impl Request
impl Request
Sourcepub fn new(
method: Method,
scheme: Option<Scheme>,
authority: Option<Authority>,
path_with_query: Option<PathAndQuery>,
headers: impl Into<Arc<HeaderMap>>,
options: Option<Arc<RequestOptions>>,
body: impl Into<BoxBody<Bytes, ErrorCode>>,
) -> (Self, impl Future<Output = Result<(), ErrorCode>> + Send + 'static)
pub fn new( method: Method, scheme: Option<Scheme>, authority: Option<Authority>, path_with_query: Option<PathAndQuery>, headers: impl Into<Arc<HeaderMap>>, options: Option<Arc<RequestOptions>>, body: impl Into<BoxBody<Bytes, ErrorCode>>, ) -> (Self, impl Future<Output = Result<(), ErrorCode>> + Send + 'static)
Sourcepub fn from_http<T>(
req: Request<T>,
) -> (Self, impl Future<Output = Result<(), ErrorCode>> + Send + 'static)
pub fn from_http<T>( req: Request<T>, ) -> (Self, impl Future<Output = Result<(), ErrorCode>> + Send + 'static)
Construct a new Request from http::Request.
This returns a Future that will be used to communicate a request processing error, if any.
Requests constructed this way will not perform any Content-Length validation.
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
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read more