pub struct TestClient { /* private fields */ }Implementations§
Source§impl TestClient
impl TestClient
pub async fn new(svc: Router) -> Self
Sourcepub fn base_url(&self) -> String
pub fn base_url(&self) -> String
returns the base URL (http://ip:port) for this TestClient
this is useful when trying to check if Location headers in responses are generated correctly as Location contains an absolute URL
pub fn get(&self, url: &str) -> RequestBuilder
pub fn head(&self, url: &str) -> RequestBuilder
pub fn post(&self, url: &str) -> RequestBuilder
pub fn put(&self, url: &str) -> RequestBuilder
pub fn patch(&self, url: &str) -> RequestBuilder
pub fn delete(&self, url: &str) -> RequestBuilder
Auto Trait Implementations§
impl Freeze for TestClient
impl !RefUnwindSafe for TestClient
impl Send for TestClient
impl Sync for TestClient
impl Unpin for TestClient
impl !UnwindSafe 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