Skip to main content

Runner

Struct Runner 

Source
pub struct Runner<L: Language, N: Analysis<L> = (), IterData = (), CustomErrorT = String>
where IterData: IterationData<L, N>, CustomErrorT: Clone,
{ pub egraph: EGraph<L, N>, pub iterations: Vec<Iteration<IterData>>, pub roots: Vec<AppliedId>, pub stop_reason: Option<StopReason<CustomErrorT>>, pub limits: RunnerLimits, pub hooks: Vec<Box<dyn FnMut(&mut Self) -> Result<(), CustomErrorT> + 'static>>, }

Fields§

§egraph: EGraph<L, N>

The EGraph used.

§iterations: Vec<Iteration<IterData>>

Data accumulated over each Iteration.

§roots: Vec<AppliedId>

The roots of expressions added by the with_expr method, in insertion order.

§stop_reason: Option<StopReason<CustomErrorT>>

Why the Runner stopped. This will be None if it hasn’t stopped yet.

§limits: RunnerLimits§hooks: Vec<Box<dyn FnMut(&mut Self) -> Result<(), CustomErrorT> + 'static>>

hooks

Implementations§

Source§

impl<L, N, IterData, CustomErrorT> Runner<L, N, IterData, CustomErrorT>
where L: Language, N: Analysis<L>, IterData: IterationData<L, N>, CustomErrorT: Clone,

Source

pub fn new(n: N) -> Self

Source

pub fn with_expr(self, expr: &RecExpr<L>) -> Self

Source

pub fn with_hook<F>(self, hook: F) -> Self
where F: FnMut(&mut Self) -> Result<(), CustomErrorT> + 'static,

Source

pub fn with_egraph(self, egraph: EGraph<L, N>) -> Self

Source

pub fn with_node_limit(self, node_limit: usize) -> Self

Source

pub fn with_iter_limit(self, iter_limit: usize) -> Self

Source

pub fn with_time_limit(self, time_limit: Duration) -> Self

Source

pub fn run(&mut self, rewrites: &[Rewrite<L, N>]) -> Report<CustomErrorT>

Trait Implementations§

Source§

impl<L, N, IterData, CustomErrorT> Default for Runner<L, N, IterData, CustomErrorT>
where L: Language, N: Analysis<L> + Default, IterData: IterationData<L, N>, CustomErrorT: Clone,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<L, N = (), IterData = (), CustomErrorT = String> !Freeze for Runner<L, N, IterData, CustomErrorT>

§

impl<L, N = (), IterData = (), CustomErrorT = String> !RefUnwindSafe for Runner<L, N, IterData, CustomErrorT>

§

impl<L, N = (), IterData = (), CustomErrorT = String> !Send for Runner<L, N, IterData, CustomErrorT>

§

impl<L, N = (), IterData = (), CustomErrorT = String> !Sync for Runner<L, N, IterData, CustomErrorT>

§

impl<L, N, IterData, CustomErrorT> Unpin for Runner<L, N, IterData, CustomErrorT>
where N: Unpin, CustomErrorT: Unpin, IterData: Unpin, L: Unpin, <N as Analysis<L>>::Data: Unpin,

§

impl<L, N, IterData, CustomErrorT> UnsafeUnpin for Runner<L, N, IterData, CustomErrorT>
where N: UnsafeUnpin, CustomErrorT: UnsafeUnpin,

§

impl<L, N = (), IterData = (), CustomErrorT = String> !UnwindSafe for Runner<L, N, IterData, CustomErrorT>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.