pub struct TestApp<R> { /* private fields */ }Expand description
In-process HTTP test harness for HttpIngress.
Uses an in-memory duplex stream and Hyper HTTP/1.1 server connection, so no TCP socket/network bind is required.
Implementations§
Source§impl<R> TestApp<R>
impl<R> TestApp<R>
pub fn new(ingress: HttpIngress<R>, resources: R) -> Self
pub fn with_host(self, host: impl Into<String>) -> Self
pub async fn send( &self, request: TestRequest, ) -> Result<TestResponse, TestHarnessError>
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for TestApp<R>
impl<R> !RefUnwindSafe for TestApp<R>
impl<R> Send for TestApp<R>
impl<R> Sync for TestApp<R>
impl<R> Unpin for TestApp<R>
impl<R> UnsafeUnpin for TestApp<R>
impl<R> !UnwindSafe for TestApp<R>
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