pub struct MockBackend { /* private fields */ }Implementations§
Source§impl MockBackend
impl MockBackend
Sourcepub fn new(
checkpoint_token: &str,
) -> (Self, CheckpointRecorder, OperationRecorder)
pub fn new( checkpoint_token: &str, ) -> (Self, CheckpointRecorder, OperationRecorder)
Create a new MockBackend with the given checkpoint token.
Returns the backend, a checkpoint call recorder, and an operation sequence recorder for test assertions.
§Examples
use durable_lambda_testing::mock_backend::MockBackend;
let (backend, calls, _ops) = MockBackend::new("token-123");
// calls can be inspected after running the handlerSourcepub fn batch_call_counter(&self) -> BatchCallCounter
pub fn batch_call_counter(&self) -> BatchCallCounter
Return the batch checkpoint call counter for test assertions.
Trait Implementations§
Source§impl DurableBackend for MockBackend
impl DurableBackend for MockBackend
Source§fn checkpoint<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
arn: &'life1 str,
checkpoint_token: &'life2 str,
updates: Vec<OperationUpdate>,
_client_token: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<CheckpointDurableExecutionOutput, DurableError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn checkpoint<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
arn: &'life1 str,
checkpoint_token: &'life2 str,
updates: Vec<OperationUpdate>,
_client_token: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<CheckpointDurableExecutionOutput, DurableError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Persist checkpoint updates for a durable execution. Read more
Source§fn batch_checkpoint<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
arn: &'life1 str,
checkpoint_token: &'life2 str,
updates: Vec<OperationUpdate>,
_client_token: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<CheckpointDurableExecutionOutput, DurableError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn batch_checkpoint<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
arn: &'life1 str,
checkpoint_token: &'life2 str,
updates: Vec<OperationUpdate>,
_client_token: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<CheckpointDurableExecutionOutput, DurableError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Persist multiple checkpoint updates in a single AWS API call. Read more
Source§fn get_execution_state<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_arn: &'life1 str,
_checkpoint_token: &'life2 str,
_next_marker: &'life3 str,
_max_items: i32,
) -> Pin<Box<dyn Future<Output = Result<GetDurableExecutionStateOutput, DurableError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn get_execution_state<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_arn: &'life1 str,
_checkpoint_token: &'life2 str,
_next_marker: &'life3 str,
_max_items: i32,
) -> Pin<Box<dyn Future<Output = Result<GetDurableExecutionStateOutput, DurableError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Get the current operation state of a durable execution (paginated). Read more
Auto Trait Implementations§
impl Freeze for MockBackend
impl !RefUnwindSafe for MockBackend
impl Send for MockBackend
impl Sync for MockBackend
impl Unpin for MockBackend
impl UnsafeUnpin for MockBackend
impl !UnwindSafe for MockBackend
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.