pub mod any;
pub mod bridge;
pub mod in_progress;
pub mod interface;
pub mod not_started;
pub mod utils;
#[cfg(test)]
mod test_utils {
#[macro_export]
macro_rules! generate_mock_handle {
(
struct $struct_name:ident;
match $match_pattern:pat => {
$($assertion:stmt);* $(;)?
}
return $return_expr:expr;
) => {
struct $struct_name;
async fn return_statement(message: ServerMessage) -> Result<ServerTransactionMessage, NanoServiceError> {
match message {
$match_pattern => {
$($assertion)*
},
_ => {
panic!("message not as expected: {:?}", message);
}
}
$return_expr
}
impl SendToTransactionClientActor for $struct_name {
fn send_to_transaction_client_actor<T: Send>(_self_ref: &mut Transaction<T>, message: ServerMessage) ->
impl Future<Output = Result<ServerTransactionMessage, NanoServiceError>> + Send {
return_statement(message)
}
}
};
}
}