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§fn clone(&self) -> FakeTransport
fn clone(&self) -> FakeTransport
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for FakeTransport
impl Default for FakeTransport
Source§fn default() -> FakeTransport
fn default() -> FakeTransport
Returns the “default value” for a type. Read more
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