[−][src]Struct exonum_testkit::migrations::AbortPolicy
Abort policy based on an iterator yielding responses to the question whether to abort the migration script when it merges data to the database.
After each "yes" answer (i.e., script abort) the policy will return "no" to the following
question without querying the iterator. This ensures that using AbortPolicy
in the
execute_until_flush
method will eventually complete the script (unless the script logic
itself is faulty).
Methods
impl<I> AbortPolicy<I> where
I: Iterator<Item = bool>,
[src]
I: Iterator<Item = bool>,
pub fn new(iter: I) -> Self
[src]
Creates a new policy around the provided iterator. The iterator may be finite; once it runs out of items, the answer to the question whether to abort the script will always be "no".
pub fn limit_merges(self, max_merges: usize) -> Self
[src]
Limits the maximum number of merges that the policy will execute. If this number is exceeded,
the AbortPolicy
will panic.
Limiting the number of merges is useful to test that a migration script does not hang up with an "unfriendly" abort schedule.
impl AbortPolicy<Repeat<bool>>
[src]
pub fn abort_repeatedly() -> Self
[src]
Creates a policy which aborts the script every other time. This ensures that the script makes progress, but tests its failure tolerance in "unfriendly" conditions.
Trait Implementations
impl<I> AbortMigration for AbortPolicy<I> where
I: Iterator<Item = bool> + Send,
[src]
I: Iterator<Item = bool> + Send,
fn is_aborted(&self) -> bool
[src]
impl<I: Debug> Debug for AbortPolicy<I>
[src]
Auto Trait Implementations
impl<I> RefUnwindSafe for AbortPolicy<I>
impl<I> Send for AbortPolicy<I> where
I: Send,
I: Send,
impl<I> Sync for AbortPolicy<I> where
I: Send,
I: Send,
impl<I> Unpin for AbortPolicy<I> where
I: Unpin,
I: Unpin,
impl<I> UnwindSafe for AbortPolicy<I>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,