[][src]Struct exonum_testkit::migrations::AbortPolicy

pub struct AbortPolicy<I> { /* fields omitted */ }

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]

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]

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

impl<I> Sync for AbortPolicy<I> where
    I: Send

impl<I> Unpin for AbortPolicy<I> where
    I: Unpin

impl<I> UnwindSafe for AbortPolicy<I>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,