pub struct MockServer { /* private fields */ }Expand description
A web server on 127.0.0.1 for testing a plugin that talks to one: it
answers every request with respond and keeps them for you to look at.
let server = MockServer::start(|req| if req.path.ends_with("/upload") { (200, String::new()) } else { (404, "no".into()) });
// … point the plugin at server.url() …
assert_eq!(server.requests().len(), 1);Implementations§
Auto Trait Implementations§
impl Freeze for MockServer
impl RefUnwindSafe for MockServer
impl Send for MockServer
impl Sync for MockServer
impl Unpin for MockServer
impl UnsafeUnpin for MockServer
impl UnwindSafe for MockServer
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