pub struct MockRequest { /* private fields */ }Implementations§
Source§impl MockRequest
impl MockRequest
pub fn new(method: Method, path: &str) -> MockRequest
pub fn with_method(&mut self, method: Method) -> &mut MockRequest
pub fn with_path(&mut self, path: &str) -> &mut MockRequest
pub fn with_query(&mut self, string: &str) -> &mut MockRequest
pub fn with_body(&mut self, bytes: &[u8]) -> &mut MockRequest
pub fn header<K>(&mut self, name: K, value: &str) -> &mut MockRequestwhere
K: IntoHeaderName,
Trait Implementations§
Source§impl RequestExt for MockRequest
impl RequestExt for MockRequest
Source§fn http_version(&self) -> Version
fn http_version(&self) -> Version
The version of HTTP being used
Source§fn virtual_root(&self) -> Option<&str>
fn virtual_root(&self) -> Option<&str>
The initial part of the request URL’s path that corresponds
to a virtual root. This allows an application to have a
virtual location that consumes part of the path.
Source§fn query_string(&self) -> Option<&str>
fn query_string(&self) -> Option<&str>
The portion of the request URL that follows the “?”
Source§fn remote_addr(&self) -> SocketAddr
fn remote_addr(&self) -> SocketAddr
The remote IP address of the client or the last proxy that
sent the request.
Source§fn content_length(&self) -> Option<u64>
fn content_length(&self) -> Option<u64>
The byte-size of the body, if any
Source§fn extensions(&self) -> &Extensions
fn extensions(&self) -> &Extensions
A readable map of extensions
Source§fn mut_extensions(&mut self) -> &mut Extensions
fn mut_extensions(&mut self) -> &mut Extensions
A mutable map of extensions
Auto Trait Implementations§
impl Freeze for MockRequest
impl !RefUnwindSafe for MockRequest
impl Send for MockRequest
impl Sync for MockRequest
impl Unpin for MockRequest
impl !UnwindSafe for MockRequest
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