pub struct TestRequest<'a, P> { /* private fields */ }Expand description
One direct request being prepared for an EndpointTest.
Implementations§
Source§impl<P> TestRequest<'_, P>where
P: HttpEndpoint,
impl<P> TestRequest<'_, P>where
P: HttpEndpoint,
Sourcepub fn json(self, value: &impl Serialize) -> Result<Self, Error>
pub fn json(self, value: &impl Serialize) -> Result<Self, Error>
Serializes a JSON body and supplies its content type.
Sourcepub fn query(self, value: &impl Serialize) -> Result<Self, Error>
pub fn query(self, value: &impl Serialize) -> Result<Self, Error>
Encodes typed URL query parameters.
Sourcepub fn path_parameter(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn path_parameter( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
Supplies one path parameter and expands it in the declared path template.
Sourcepub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
pub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
Supplies one request header.
Sourcepub async fn send(self) -> Result<TestResponse, EndpointTestError>
pub async fn send(self) -> Result<TestResponse, EndpointTestError>
Invokes the Endpoint directly and returns its intentional HTTP response.
Trait Implementations§
Auto Trait Implementations§
impl<'a, P> Freeze for TestRequest<'a, P>
impl<'a, P> RefUnwindSafe for TestRequest<'a, P>where
&'a P: RefUnwindSafe,
impl<'a, P> Send for TestRequest<'a, P>
impl<'a, P> Sync for TestRequest<'a, P>
impl<'a, P> Unpin for TestRequest<'a, P>
impl<'a, P> UnsafeUnpin for TestRequest<'a, P>where
&'a P: UnsafeUnpin,
impl<'a, P> UnwindSafe for TestRequest<'a, P>where
&'a P: UnwindSafe,
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