pub struct DirectRequest { /* private fields */ }Expand description
What a caller sent, stated without a transport.
Whatever moves bytes decides how a request arrives; this is only what arrived.
Implementations§
Source§impl DirectRequest
impl DirectRequest
Sourcepub fn new(method: HttpMethod, path: &str) -> DirectRequest
pub fn new(method: HttpMethod, path: &str) -> DirectRequest
States a request for one path under one method.
Sourcepub fn with_query(self, query: &str) -> DirectRequest
pub fn with_query(self, query: &str) -> DirectRequest
States the query string the caller sent, without its leading separator.
Sourcepub fn with_header(self, name: &str, value: &str) -> DirectRequest
pub fn with_header(self, name: &str, value: &str) -> DirectRequest
States one header the caller sent.
Sourcepub fn with_body(self, body: impl Into<Vec<u8>>) -> DirectRequest
pub fn with_body(self, body: impl Into<Vec<u8>>) -> DirectRequest
States the body the caller sent.
Sourcepub fn method(&self) -> Option<HttpMethod>
pub fn method(&self) -> Option<HttpMethod>
Returns the method this request was sent under.
Sourcepub fn header(&self, name: &str) -> Option<&str>
pub fn header(&self, name: &str) -> Option<&str>
Returns the value of one header, matched without regard to case.
Trait Implementations§
Source§impl Clone for DirectRequest
impl Clone for DirectRequest
Source§fn clone(&self) -> DirectRequest
fn clone(&self) -> DirectRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DirectRequest
impl Debug for DirectRequest
Source§impl Default for DirectRequest
impl Default for DirectRequest
Source§fn default() -> DirectRequest
fn default() -> DirectRequest
Returns the “default value” for a type. Read more
impl Eq for DirectRequest
Source§impl FromHeadAlg for DirectRequest
impl FromHeadAlg for DirectRequest
Source§fn from_head(request: &DirectRequest) -> Option<Self>
fn from_head(request: &DirectRequest) -> Option<Self>
Reads the argument from everything that arrived before the body.
Source§impl PartialEq for DirectRequest
impl PartialEq for DirectRequest
impl StructuralPartialEq for DirectRequest
Auto Trait Implementations§
impl Freeze for DirectRequest
impl RefUnwindSafe for DirectRequest
impl Send for DirectRequest
impl Sync for DirectRequest
impl Unpin for DirectRequest
impl UnsafeUnpin for DirectRequest
impl UnwindSafe for DirectRequest
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<This> HttpProgramExt<This> for This
impl<This> HttpProgramExt<This> for This
Source§fn compile_http<Program>(
&self,
program: Program,
) -> <Program as HttpProgramAlg<This>>::Routewhere
Program: HttpProgramAlg<This>,
fn compile_http<Program>(
&self,
program: Program,
) -> <Program as HttpProgramAlg<This>>::Routewhere
Program: HttpProgramAlg<This>,
Compiles a named HTTP program with this interpreter.