pub struct RequestBuilder { /* private fields */ }Expand description
Builder for test / embedded requests. state and extensions stay empty —
crate::App::handle fills router state.
Implementations§
Source§impl RequestBuilder
impl RequestBuilder
pub fn method(self, method: Method) -> Self
pub fn path(self, path: impl Into<String>) -> Self
pub fn header(self, name: impl AsRef<str>, value: impl AsRef<str>) -> Self
pub fn body(self, body: impl Into<Bytes>) -> Self
pub fn body_limit(self, limit: usize) -> Self
pub fn query_param( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
pub fn scheme(self, scheme: impl Into<String>) -> Self
pub fn host(self, host: impl Into<String>) -> Self
pub fn build(self) -> Request
Auto Trait Implementations§
impl !Freeze for RequestBuilder
impl RefUnwindSafe for RequestBuilder
impl Send for RequestBuilder
impl Sync for RequestBuilder
impl Unpin for RequestBuilder
impl UnsafeUnpin for RequestBuilder
impl UnwindSafe for RequestBuilder
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