pub struct FakeTransport { /* private fields */ }Expand description
Laravel-style Http::fake() registry.
Implementations§
Source§impl FakeTransport
impl FakeTransport
pub fn new() -> Self
pub fn get(self, url: impl Into<String>, body: impl Into<StubBody>) -> Self
pub fn post(self, url: impl Into<String>, status: u16) -> Self
pub fn respond( self, method: Method, url: impl Into<String>, status: u16, body: impl Into<StubBody>, ) -> Self
pub fn fail(self, url: impl Into<String>, msg: impl Into<String>) -> Self
pub fn assert_sent(&self, method: Method, url: &str)
pub fn assert_sent_count(&self, n: usize)
pub fn assert_not_sent(&self, url: &str)
pub fn sent(&self) -> Vec<OutRequest>
Trait Implementations§
Source§impl Clone for FakeTransport
impl Clone for FakeTransport
Source§impl Default for FakeTransport
impl Default for FakeTransport
Source§impl Transport for FakeTransport
impl Transport for FakeTransport
fn send(&self, req: OutRequest) -> BoxFuture<Result<OutResponse, HttpError>>
Auto Trait Implementations§
impl Freeze for FakeTransport
impl RefUnwindSafe for FakeTransport
impl Send for FakeTransport
impl Sync for FakeTransport
impl Unpin for FakeTransport
impl UnsafeUnpin for FakeTransport
impl UnwindSafe for FakeTransport
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