pub struct IntegrationTestContext<'a, H: Handler> { /* private fields */ }Expand description
Context available during an integration test.
Implementations§
Source§impl<'a, H: Handler + 'static> IntegrationTestContext<'a, H>
impl<'a, H: Handler + 'static> IntegrationTestContext<'a, H>
Sourcepub fn client(&self) -> &TestClient<H>
pub fn client(&self) -> &TestClient<H>
Returns the test client.
Sourcepub fn fixture<F: TestFixture + 'static>(&self) -> Option<&F>
pub fn fixture<F: TestFixture + 'static>(&self) -> Option<&F>
Gets a reference to a registered fixture.
Returns None if the fixture type was not registered.
Sourcepub fn fixture_mut<F: TestFixture + 'static>(&self) -> Option<&mut F>
pub fn fixture_mut<F: TestFixture + 'static>(&self) -> Option<&mut F>
Gets a mutable reference to a registered fixture.
Returns None if the fixture type was not registered.
Sourcepub fn get(&self, path: &str) -> RequestBuilder<'_, H>
pub fn get(&self, path: &str) -> RequestBuilder<'_, H>
Starts building a GET request.
Sourcepub fn post(&self, path: &str) -> RequestBuilder<'_, H>
pub fn post(&self, path: &str) -> RequestBuilder<'_, H>
Starts building a POST request.
Sourcepub fn put(&self, path: &str) -> RequestBuilder<'_, H>
pub fn put(&self, path: &str) -> RequestBuilder<'_, H>
Starts building a PUT request.
Sourcepub fn delete(&self, path: &str) -> RequestBuilder<'_, H>
pub fn delete(&self, path: &str) -> RequestBuilder<'_, H>
Starts building a DELETE request.
Sourcepub fn patch(&self, path: &str) -> RequestBuilder<'_, H>
pub fn patch(&self, path: &str) -> RequestBuilder<'_, H>
Starts building a PATCH request.
Sourcepub fn options(&self, path: &str) -> RequestBuilder<'_, H>
pub fn options(&self, path: &str) -> RequestBuilder<'_, H>
Starts building an OPTIONS request.
Sourcepub fn request(&self, method: Method, path: &str) -> RequestBuilder<'_, H>
pub fn request(&self, method: Method, path: &str) -> RequestBuilder<'_, H>
Starts building a request with a custom method.
Auto Trait Implementations§
impl<'a, H> Freeze for IntegrationTestContext<'a, H>
impl<'a, H> !RefUnwindSafe for IntegrationTestContext<'a, H>
impl<'a, H> !Send for IntegrationTestContext<'a, H>
impl<'a, H> !Sync for IntegrationTestContext<'a, H>
impl<'a, H> Unpin for IntegrationTestContext<'a, H>
impl<'a, H> !UnwindSafe for IntegrationTestContext<'a, H>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).