pub struct ReplayHandler<'a> { /* private fields */ }Expand description
Replays recorded external results (ReplayMode::Recorded).
For each call, returns the next recorded result if it matches (name + args),
else ExternalResult::Fallback — the ink fallback body — for
uncovered / divergent / past-cap calls. Re-executes nothing, so effects
don’t re-fire and reads stay faithful.
For ReplayMode::Live, don’t use this handler: supply the consumer’s real
handler instead so everything runs live.
Implementations§
Source§impl<'a> ReplayHandler<'a>
impl<'a> ReplayHandler<'a>
Sourcepub fn new(recorder: &'a mut ReplayRecorder) -> Self
pub fn new(recorder: &'a mut ReplayRecorder) -> Self
Build a replay handler over recorder, resetting its cursor so replay
starts from the first recorded result.
Trait Implementations§
Source§impl ExternalFnHandler for ReplayHandler<'_>
impl ExternalFnHandler for ReplayHandler<'_>
Auto Trait Implementations§
impl<'a> !Freeze for ReplayHandler<'a>
impl<'a> !RefUnwindSafe for ReplayHandler<'a>
impl<'a> !Sync for ReplayHandler<'a>
impl<'a> !UnwindSafe for ReplayHandler<'a>
impl<'a> Send for ReplayHandler<'a>
impl<'a> Unpin for ReplayHandler<'a>
impl<'a> UnsafeUnpin for ReplayHandler<'a>
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