pub enum TestOption<'a, S> {
    BuiltInCommands(fn() -> HashMap<&'static str, BuiltIn<S>>),
    BuiltInCommandsDyn(Box<dyn Fn() -> HashMap<&'static str, BuiltIn<S>> + 'a>),
    CustomVMInitialization(fn(_: &mut VM<S>)),
    CustomVMInitializationDyn(Box<dyn Fn(&mut VM<S>) + 'a>),
    AllowUndefinedCommands(bool),
    RecoverFromErrors(bool),
}
Expand description

Option passed to a test runner.

Variants§

§

BuiltInCommands(fn() -> HashMap<&'static str, BuiltIn<S>>)

The built-in commands are the result of invoking the provided static function.

Overrides previous InitialCommands or InitialCommandsDyn options.

§

BuiltInCommandsDyn(Box<dyn Fn() -> HashMap<&'static str, BuiltIn<S>> + 'a>)

The built-in commands are the result of invoking the provided closure.

Overrides previous InitialCommands or InitialCommandsDyn options.

§

CustomVMInitialization(fn(_: &mut VM<S>))

The provided static function is invoked after the VM is created and before execution starts. This can be used to provide more custom VM initialization.

Overrides previous CustomVMInitialization or CustomVMInitializationDyn options.

§

CustomVMInitializationDyn(Box<dyn Fn(&mut VM<S>) + 'a>)

The provided closure is invoked after the VM is created and before execution starts. This can be used to provide more custom VM initialization.

Overrides previous CustomVMInitialization or CustomVMInitializationDyn options.

§

AllowUndefinedCommands(bool)

Whether undefined commands raise an error.

Overrides previous AllowUndefinedCommands options.

§

RecoverFromErrors(bool)

Whether to recover from errors.

Overrides previous RecoverFromErrors options.

Auto Trait Implementations§

§

impl<'a, S> !RefUnwindSafe for TestOption<'a, S>

§

impl<'a, S> !Send for TestOption<'a, S>

§

impl<'a, S> !Sync for TestOption<'a, S>

§

impl<'a, S> Unpin for TestOption<'a, S>

§

impl<'a, S> !UnwindSafe for TestOption<'a, S>

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,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

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.
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.
source§

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

Performs the conversion.