pub struct ScriptedSimulator { /* private fields */ }Expand description
A simulator that answers every call with the configured script and records the requests it was asked about.
Implementations§
Source§impl ScriptedSimulator
impl ScriptedSimulator
Sourcepub fn new() -> Self
pub fn new() -> Self
A simulator with no script: it errors like an unreachable endpoint until a script is set.
Sourcepub fn respond(self, report: SimulationReport) -> Self
pub fn respond(self, report: SimulationReport) -> Self
Answers every simulation with report.
Trait Implementations§
Source§impl Clone for ScriptedSimulator
impl Clone for ScriptedSimulator
Source§impl Default for ScriptedSimulator
impl Default for ScriptedSimulator
Source§impl Simulator for ScriptedSimulator
impl Simulator for ScriptedSimulator
Source§fn simulate<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 Request,
) -> Pin<Box<dyn Future<Output = Result<SimulationReport, SimError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn simulate<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 Request,
) -> Pin<Box<dyn Future<Output = Result<SimulationReport, SimError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Simulates the request against current state. Read more
Auto Trait Implementations§
impl Freeze for ScriptedSimulator
impl RefUnwindSafe for ScriptedSimulator
impl Send for ScriptedSimulator
impl Sync for ScriptedSimulator
impl Unpin for ScriptedSimulator
impl UnsafeUnpin for ScriptedSimulator
impl UnwindSafe for ScriptedSimulator
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