pub struct TestClient { /* private fields */ }Expand description
Test client over a compiled Server, always tracking cookies.
Implementations§
Source§impl TestClient
impl TestClient
pub fn new(app: App) -> Result<Self>
pub fn server(&self) -> &Server
Sourcepub fn on_request<F>(&self, hook: F)
pub fn on_request<F>(&self, hook: F)
Run hook on every request before dispatch (stacked; call order preserved).
Sourcepub fn clear_request_hooks(&self)
pub fn clear_request_hooks(&self)
Drop all Self::on_request hooks.
pub fn get(&self, path: impl Into<String>) -> ClientRequest<'_>
pub fn post(&self, path: impl Into<String>) -> ClientRequest<'_>
pub fn put(&self, path: impl Into<String>) -> ClientRequest<'_>
pub fn patch(&self, path: impl Into<String>) -> ClientRequest<'_>
pub fn delete(&self, path: impl Into<String>) -> ClientRequest<'_>
Auto Trait Implementations§
impl !Freeze for TestClient
impl !RefUnwindSafe for TestClient
impl !UnwindSafe for TestClient
impl Send for TestClient
impl Sync for TestClient
impl Unpin for TestClient
impl UnsafeUnpin for TestClient
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