Struct test_casing::decorators::RetryErrors
source · pub struct RetryErrors<E> { /* private fields */ }
Expand description
Test decorator that retries a wrapped test a certain number of times only if an error matches the specified predicate.
Constructed using Retry::on_error()
.
§Examples
use test_casing::{decorate, decorators::{Retry, RetryErrors}};
use std::error::Error;
const RETRY: RetryErrors<Box<dyn Error>> = Retry::times(3)
.on_error(|err| err.to_string().contains("retry please"));
#[test]
#[decorate(RETRY)]
fn test_with_retries() -> Result<(), Box<dyn Error>> {
// test logic
}
Trait Implementations§
source§impl<E> Debug for RetryErrors<E>
impl<E> Debug for RetryErrors<E>
source§impl<E: Display + 'static> DecorateTest<Result<(), E>> for RetryErrors<E>
impl<E: Display + 'static> DecorateTest<Result<(), E>> for RetryErrors<E>
Auto Trait Implementations§
impl<E> RefUnwindSafe for RetryErrors<E>
impl<E> Send for RetryErrors<E>
impl<E> Sync for RetryErrors<E>
impl<E> Unpin for RetryErrors<E>
impl<E> UnwindSafe for RetryErrors<E>
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