Struct openraft::testing::Suite

source ·
pub struct Suite<C, S, B>where
    C: RaftTypeConfig,
    C::D: AppData + Debug,
    C::R: AppDataResponse + Debug,
    S: RaftStorage<C>,
    B: StoreBuilder<C, S>,{ /* private fields */ }
Expand description

Test suite to ensure a RaftStore impl works as expected.

Usage:

Implementations§

source§

impl<C, S, B> Suite<C, S, B>where C: RaftTypeConfig, C::D: AppData + Debug, C::R: AppDataResponse + Debug, C::NodeId: From<u64>, S: RaftStorage<C>, B: StoreBuilder<C, S>,

source

pub fn test_all(builder: B) -> Result<(), StorageError<C::NodeId>>

source

pub fn test_store(builder: &B) -> Result<(), StorageError<C::NodeId>>

source

pub async fn last_membership_in_log_initial( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn last_membership_in_log( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn last_membership_in_log_multi_step( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_membership_initial( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_membership_from_log_and_empty_sm( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_membership_from_log_and_sm( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_initial_state_without_init( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_initial_state_with_state( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_initial_state_membership_from_log_and_sm( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_initial_state_last_log_gt_sm( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_initial_state_last_log_lt_sm( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_initial_state_log_ids( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn save_vote(store: S) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_log_entries(store: S) -> Result<(), StorageError<C::NodeId>>

source

pub async fn try_get_log_entry(store: S) -> Result<(), StorageError<C::NodeId>>

source

pub async fn initial_logs(store: S) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_log_state(store: S) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_log_id(store: S) -> Result<(), StorageError<C::NodeId>>

source

pub async fn last_id_in_log(store: S) -> Result<(), StorageError<C::NodeId>>

source

pub async fn last_applied_state(store: S) -> Result<(), StorageError<C::NodeId>>

source

pub async fn purge_logs_upto_0(store: S) -> Result<(), StorageError<C::NodeId>>

source

pub async fn purge_logs_upto_5(store: S) -> Result<(), StorageError<C::NodeId>>

source

pub async fn purge_logs_upto_20(store: S) -> Result<(), StorageError<C::NodeId>>

source

pub async fn delete_logs_since_11( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn delete_logs_since_0( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn append_to_log(store: S) -> Result<(), StorageError<C::NodeId>>

source

pub async fn snapshot_meta(store: S) -> Result<(), StorageError<C::NodeId>>

source

pub async fn feed_10_logs_vote_self( sto: &mut S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn default_vote(sto: &mut S) -> Result<(), StorageError<C::NodeId>>

source§

impl<C, S, B> Suite<C, S, B>where C: RaftTypeConfig, C::D: AppData + Debug, C::R: AppDataResponse + Debug, C::NodeId: From<u64>, S: RaftStorage<C>, B: StoreBuilder<C, S>,

source

pub fn test_store_defensive(builder: &B) -> Result<(), StorageError<C::NodeId>>

source

pub async fn df_get_membership_config_dirty_log( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn df_get_initial_state_dirty_log( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn df_save_vote_ascending( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn df_get_log_entries(store: S) -> Result<(), StorageError<C::NodeId>>

source

pub async fn df_append_to_log_nonempty_input( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn df_append_to_log_nonconsecutive_input( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn df_append_to_log_eq_last_plus_one( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn df_append_to_log_eq_last_applied_plus_one( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn df_append_to_log_gt_last_log_id( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn df_append_to_log_gt_last_applied_id( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn df_apply_nonempty_input( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn df_apply_index_eq_last_applied_plus_one( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn df_apply_gt_last_applied_id( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn df_purge_applied_le_last_applied( store: S ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn df_delete_conflict_gt_last_applied( store: S ) -> Result<(), StorageError<C::NodeId>>

Auto Trait Implementations§

§

impl<C, S, B> RefUnwindSafe for Suite<C, S, B>where B: RefUnwindSafe, C: RefUnwindSafe, S: RefUnwindSafe,

§

impl<C, S, B> Send for Suite<C, S, B>

§

impl<C, S, B> Sync for Suite<C, S, B>

§

impl<C, S, B> Unpin for Suite<C, S, B>where B: Unpin, C: Unpin, S: Unpin,

§

impl<C, S, B> UnwindSafe for Suite<C, S, B>where B: UnwindSafe, C: UnwindSafe, S: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

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

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> AppDataResponse for Twhere T: Send + Sync + 'static + OptionalSerde,