pub struct FakeExecutor {
pub call_count: Arc<AtomicUsize>,
pub reconnect_count: Arc<AtomicUsize>,
/* private fields */
}Expand description
Fake executor for testing retry behavior.
Configured with a sequence of results to return. Each call to
execute_command consumes the next result. After exhausting the
sequence, returns Ok(()).
Fields§
§call_count: Arc<AtomicUsize>Counter of how many times execute_command was called.
reconnect_count: Arc<AtomicUsize>Counter of how many times reconnect was called.
Implementations§
Source§impl FakeExecutor
impl FakeExecutor
Sourcepub fn new(results: Vec<Result<(), FakeError>>) -> Self
pub fn new(results: Vec<Result<(), FakeError>>) -> Self
Creates a new fake executor with the given result sequence.
Sourcepub fn call_count(&self) -> Arc<AtomicUsize>
pub fn call_count(&self) -> Arc<AtomicUsize>
Returns a shared reference to the call counter.
Sourcepub fn reconnect_count(&self) -> Arc<AtomicUsize>
pub fn reconnect_count(&self) -> Arc<AtomicUsize>
Returns a shared reference to the reconnect counter.
Trait Implementations§
Source§impl RedisCommandExecutor for FakeExecutor
impl RedisCommandExecutor for FakeExecutor
Source§fn execute_command<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
_cmd: &'life1 RedisCommand,
_exchange: &'life2 mut Exchange,
) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute_command<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
_cmd: &'life1 RedisCommand,
_exchange: &'life2 mut Exchange,
) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Execute a Redis command against the given exchange.
Auto Trait Implementations§
impl !RefUnwindSafe for FakeExecutor
impl !UnwindSafe for FakeExecutor
impl Freeze for FakeExecutor
impl Send for FakeExecutor
impl Sync for FakeExecutor
impl Unpin for FakeExecutor
impl UnsafeUnpin for FakeExecutor
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