pub struct RetryAssertion<F>where
F: Fn() -> AssertionCheckResult,{ /* private fields */ }Expand description
Implementations§
Source§impl<F> RetryAssertion<F>where
F: Fn() -> AssertionCheckResult,
impl<F> RetryAssertion<F>where
F: Fn() -> AssertionCheckResult,
Sourcepub const fn with_timeout(self, timeout: Duration) -> Self
pub const fn with_timeout(self, timeout: Duration) -> Self
Set the timeout duration
Sourcepub const fn with_poll_interval(self, interval: Duration) -> Self
pub const fn with_poll_interval(self, interval: Duration) -> Self
Set the poll interval
Sourcepub const fn with_max_retries(self, max: usize) -> Self
pub const fn with_max_retries(self, max: usize) -> Self
Set the maximum number of retries
Sourcepub fn with_description(self, desc: impl Into<String>) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
Set a description for the assertion
Sourcepub const fn with_config(self, config: RetryConfig) -> Self
pub const fn with_config(self, config: RetryConfig) -> Self
Set the full config
Sourcepub const fn config(&self) -> &RetryConfig
pub const fn config(&self) -> &RetryConfig
Get the current config
Sourcepub fn verify(&self) -> Result<RetryResult, RetryError>
pub fn verify(&self) -> Result<RetryResult, RetryError>
Verify the assertion, retrying until success or timeout
§Errors
Returns error if the assertion fails after all retries
Sourcepub fn verify_once(&self) -> Result<(), RetryError>
pub fn verify_once(&self) -> Result<(), RetryError>
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for RetryAssertion<F>where
F: Freeze,
impl<F> RefUnwindSafe for RetryAssertion<F>where
F: RefUnwindSafe,
impl<F> Send for RetryAssertion<F>where
F: Send,
impl<F> Sync for RetryAssertion<F>where
F: Sync,
impl<F> Unpin for RetryAssertion<F>where
F: Unpin,
impl<F> UnsafeUnpin for RetryAssertion<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for RetryAssertion<F>where
F: UnwindSafe,
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> 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 more