pub struct IoOracle { /* private fields */ }Expand description
Default I/O-based verification oracle
Implementations§
Source§impl IoOracle
impl IoOracle
Sourcepub fn with_timeout(self, timeout_ms: u64) -> Self
pub fn with_timeout(self, timeout_ms: u64) -> Self
Create an I/O oracle with custom timeout
Sourcepub fn with_diff_options(self, options: DiffOptions) -> Self
pub fn with_diff_options(self, options: DiffOptions) -> Self
Set diff options for comparison
Sourcepub fn with_source_executor(self, executor: Box<dyn Executor>) -> Self
pub fn with_source_executor(self, executor: Box<dyn Executor>) -> Self
Set the source language executor
Sourcepub fn with_target_executor(self, executor: Box<dyn Executor>) -> Self
pub fn with_target_executor(self, executor: Box<dyn Executor>) -> Self
Set the target language executor
Sourcepub fn verify(
&self,
source_code: &str,
target_code: &str,
input: &str,
source_lang: Language,
target_lang: Language,
) -> Result<VerificationResult>
pub fn verify( &self, source_code: &str, target_code: &str, input: &str, source_lang: Language, target_lang: Language, ) -> Result<VerificationResult>
Sourcepub fn verify_python(
&self,
code: &str,
expected_output: &str,
) -> Result<DiffResult>
pub fn verify_python( &self, code: &str, expected_output: &str, ) -> Result<DiffResult>
Sourcepub fn verify_python_with_input(
&self,
code: &str,
input: &str,
expected_output: &str,
) -> Result<DiffResult>
pub fn verify_python_with_input( &self, code: &str, input: &str, expected_output: &str, ) -> Result<DiffResult>
Execute Python code and verify against expected output with input
§Errors
Returns an error if execution fails
Sourcepub fn execute_python(&self, code: &str, input: &str) -> Result<ExecutionResult>
pub fn execute_python(&self, code: &str, input: &str) -> Result<ExecutionResult>
Sourcepub fn diff_options(&self) -> &DiffOptions
pub fn diff_options(&self) -> &DiffOptions
Get diff options
Trait Implementations§
Source§impl Oracle for IoOracle
impl Oracle for IoOracle
Source§fn execute_source(&self, code: &str, input: &str) -> Result<ExecutionResult>
fn execute_source(&self, code: &str, input: &str) -> Result<ExecutionResult>
Execute source code and return result Read more
Source§fn execute_target(&self, code: &str, input: &str) -> Result<ExecutionResult>
fn execute_target(&self, code: &str, input: &str) -> Result<ExecutionResult>
Execute target code and return result Read more
Source§fn compare(&self, source: &ExecutionResult, target: &ExecutionResult) -> Verdict
fn compare(&self, source: &ExecutionResult, target: &ExecutionResult) -> Verdict
Compare source and target execution results
Source§fn timeout_ms(&self) -> u64
fn timeout_ms(&self) -> u64
Get the timeout for execution in milliseconds
Auto Trait Implementations§
impl Freeze for IoOracle
impl !RefUnwindSafe for IoOracle
impl Send for IoOracle
impl Sync for IoOracle
impl Unpin for IoOracle
impl UnsafeUnpin for IoOracle
impl !UnwindSafe for IoOracle
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more