pub struct TestRequest { /* private fields */ }Expand description
Test request builder
Implementations§
Source§impl TestRequest
impl TestRequest
Sourcepub fn try_header(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Result<Self, TestRequestError>
pub fn try_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Result<Self, TestRequestError>
Add a header without panicking on invalid header input.
Sourcepub fn try_json<T: Serialize>(self, body: &T) -> Result<Self, TestRequestError>
pub fn try_json<T: Serialize>(self, body: &T) -> Result<Self, TestRequestError>
Set JSON body without panicking.
Sourcepub fn try_build(self) -> Result<Request<Full<Bytes>>, TestRequestError>
pub fn try_build(self) -> Result<Request<Full<Bytes>>, TestRequestError>
Build the request without panicking.
Sourcepub fn build_oxidite(self) -> OxiditeRequest
pub fn build_oxidite(self) -> OxiditeRequest
Build an Oxidite request body for direct handler/router invocation.
Auto Trait Implementations§
impl Freeze for TestRequest
impl RefUnwindSafe for TestRequest
impl Send for TestRequest
impl Sync for TestRequest
impl Unpin for TestRequest
impl UnsafeUnpin for TestRequest
impl UnwindSafe for TestRequest
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