Enum cranelift_reader::RunCommand
source · [−]pub enum RunCommand {
Print(Invocation),
Run(Invocation, Comparison, Vec<DataValue>),
}
Expand description
A run command appearing in a test file.
For parsing, see Parser::parse_run_command
Variants
Print(Invocation)
Invoke a function and print its result.
Run(Invocation, Comparison, Vec<DataValue>)
Invoke a function and compare its result to a value sequence.
Implementations
sourceimpl RunCommand
impl RunCommand
sourcepub fn run<F>(&self, invoke_fn: F) -> Result<(), String>where
F: FnOnce(&str, &[DataValue]) -> Result<Vec<DataValue>, String>,
pub fn run<F>(&self, invoke_fn: F) -> Result<(), String>where
F: FnOnce(&str, &[DataValue]) -> Result<Vec<DataValue>, String>,
Run the RunCommand:
- for RunCommand::Print, print the returned values from invoking the function.
- for RunCommand::Run, compare the returned values from the invoked function and
return an
Err
with a descriptive string if the comparison fails.
Accepts a function used for invoking the actual execution of the command. This function,
invoked_fn
, is passed the function name and function arguments of the Invocation.
Trait Implementations
sourceimpl Debug for RunCommand
impl Debug for RunCommand
sourceimpl Display for RunCommand
impl Display for RunCommand
sourceimpl PartialEq<RunCommand> for RunCommand
impl PartialEq<RunCommand> for RunCommand
sourcefn eq(&self, other: &RunCommand) -> bool
fn eq(&self, other: &RunCommand) -> bool
impl StructuralPartialEq for RunCommand
Auto Trait Implementations
impl RefUnwindSafe for RunCommand
impl Send for RunCommand
impl Sync for RunCommand
impl Unpin for RunCommand
impl UnwindSafe for RunCommand
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more