pub enum RuntimeMode {
Sync,
TokioCurrentThread,
}Expand description
Runtime mode for scenario test execution (canonical definition).
This type is re-exported from rstest_bdd_policy to keep the public API in
rstest_bdd::execution stable for downstream users.
Runtime mode for scenario test execution.
§Examples
use rstest_bdd_policy::RuntimeMode;
let mode = RuntimeMode::default();
assert!(!mode.is_async());Variants§
Sync
Synchronous execution (default).
TokioCurrentThread
Tokio current-thread runtime (#[tokio::test(flavor = "current_thread")]).
Implementations§
Source§impl RuntimeMode
impl RuntimeMode
Sourcepub const fn is_async(self) -> bool
pub const fn is_async(self) -> bool
Returns true if this mode requires async test generation.
§Examples
use rstest_bdd_policy::RuntimeMode;
assert!(!RuntimeMode::Sync.is_async());
assert!(RuntimeMode::TokioCurrentThread.is_async());Sourcepub const fn test_attribute_hint(self) -> TestAttributeHint
pub const fn test_attribute_hint(self) -> TestAttributeHint
Returns a hint for which test attributes to generate.
§Examples
use rstest_bdd_policy::{RuntimeMode, TestAttributeHint};
assert_eq!(
RuntimeMode::Sync.test_attribute_hint(),
TestAttributeHint::RstestOnly
);
assert_eq!(
RuntimeMode::TokioCurrentThread.test_attribute_hint(),
TestAttributeHint::RstestWithTokioCurrentThread
);Trait Implementations§
Source§impl Clone for RuntimeMode
impl Clone for RuntimeMode
Source§fn clone(&self) -> RuntimeMode
fn clone(&self) -> RuntimeMode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for RuntimeMode
Source§impl Debug for RuntimeMode
impl Debug for RuntimeMode
Source§impl Default for RuntimeMode
impl Default for RuntimeMode
Source§fn default() -> RuntimeMode
fn default() -> RuntimeMode
Returns the “default value” for a type. Read more
impl Eq for RuntimeMode
Source§impl PartialEq for RuntimeMode
impl PartialEq for RuntimeMode
impl StructuralPartialEq for RuntimeMode
Auto Trait Implementations§
impl Forget for RuntimeMode
impl Freeze for RuntimeMode
impl RefUnwindSafe for RuntimeMode
impl Send for RuntimeMode
impl Sync for RuntimeMode
impl Unpin for RuntimeMode
impl UnsafeUnpin for RuntimeMode
impl UnwindSafe for RuntimeMode
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.