Skip to main content

MatchIterator

Struct MatchIterator 

Source
pub struct MatchIterator<'a, Cfg: EGraphConfig, L: LitVal, S: Copy, const T: bool, const P: bool> { /* private fields */ }

Implementations§

Source§

impl<'a, Cfg, L, S: Copy, const T: bool, const P: bool> MatchIterator<'a, Cfg, L, S, T, P>
where Cfg: EGraphConfig, L: LitVal, MSetCanon: VarCanon<Cfg::G, Cfg::C>,

Source

pub fn new( plan: &'a QueryPlan<Cfg::O, Cfg::Index, L>, eg: &'a EGraph<Cfg, L, T, P>, index: &'a VariantIndex<'a, Cfg>, globals: &'a GlobalCtx<S, Cfg::G>, ) -> Self

Source

pub fn env(&self) -> &Match<Cfg>

Source

pub fn cloned_iter(self) -> ClonedMatchIter<'a, Cfg, L, S, T, P> ⓘ

Composable iterator that clones each match on yield.

Source

pub fn collect_set(&mut self, shape: &MatchShape) -> MatchSet<Cfg>

Collect all remaining matches into a MatchSet.

Source

pub fn next_match(&mut self) -> bool

Advance to the next match. Returns true if found (read via env()).

Auto Trait Implementations§

§

impl<'a, Cfg, L, S, const T: bool, const P: bool> Freeze for MatchIterator<'a, Cfg, L, S, T, P>
where &'a QueryPlan<<Cfg as EGraphConfig>::O, <Cfg as EGraphConfig>::Index, L>: Freeze, &'a EGraph<Cfg, L, T, P>: Freeze, &'a VariantIndex<'a, Cfg>: Freeze, &'a GlobalCtx<S, <Cfg as EGraphConfig>::G>: Freeze, Match<Cfg>: Freeze, Vec<Frame<'a, Cfg>>: Freeze,

§

impl<'a, Cfg, L, S, const T: bool, const P: bool> RefUnwindSafe for MatchIterator<'a, Cfg, L, S, T, P>
where &'a QueryPlan<<Cfg as EGraphConfig>::O, <Cfg as EGraphConfig>::Index, L>: RefUnwindSafe, &'a EGraph<Cfg, L, T, P>: RefUnwindSafe, &'a VariantIndex<'a, Cfg>: RefUnwindSafe, &'a GlobalCtx<S, <Cfg as EGraphConfig>::G>: RefUnwindSafe, Match<Cfg>: RefUnwindSafe, Vec<Frame<'a, Cfg>>: RefUnwindSafe,

§

impl<'a, Cfg, L, S, const T: bool, const P: bool> Send for MatchIterator<'a, Cfg, L, S, T, P>
where &'a QueryPlan<<Cfg as EGraphConfig>::O, <Cfg as EGraphConfig>::Index, L>: Send, &'a EGraph<Cfg, L, T, P>: Send, &'a VariantIndex<'a, Cfg>: Send, &'a GlobalCtx<S, <Cfg as EGraphConfig>::G>: Send, Match<Cfg>: Send, Vec<Frame<'a, Cfg>>: Send,

§

impl<'a, Cfg, L, S, const T: bool, const P: bool> Sync for MatchIterator<'a, Cfg, L, S, T, P>
where &'a QueryPlan<<Cfg as EGraphConfig>::O, <Cfg as EGraphConfig>::Index, L>: Sync, &'a EGraph<Cfg, L, T, P>: Sync, &'a VariantIndex<'a, Cfg>: Sync, &'a GlobalCtx<S, <Cfg as EGraphConfig>::G>: Sync, Match<Cfg>: Sync, Vec<Frame<'a, Cfg>>: Sync,

§

impl<'a, Cfg, L, S, const T: bool, const P: bool> Unpin for MatchIterator<'a, Cfg, L, S, T, P>
where &'a QueryPlan<<Cfg as EGraphConfig>::O, <Cfg as EGraphConfig>::Index, L>: Unpin, &'a EGraph<Cfg, L, T, P>: Unpin, &'a VariantIndex<'a, Cfg>: Unpin, &'a GlobalCtx<S, <Cfg as EGraphConfig>::G>: Unpin, Match<Cfg>: Unpin, Vec<Frame<'a, Cfg>>: Unpin,

§

impl<'a, Cfg, L, S, const T: bool, const P: bool> UnsafeUnpin for MatchIterator<'a, Cfg, L, S, T, P>
where &'a QueryPlan<<Cfg as EGraphConfig>::O, <Cfg as EGraphConfig>::Index, L>: UnsafeUnpin, &'a EGraph<Cfg, L, T, P>: UnsafeUnpin, &'a VariantIndex<'a, Cfg>: UnsafeUnpin, &'a GlobalCtx<S, <Cfg as EGraphConfig>::G>: UnsafeUnpin, Match<Cfg>: UnsafeUnpin, Vec<Frame<'a, Cfg>>: UnsafeUnpin,

§

impl<'a, Cfg, L, S, const T: bool, const P: bool> UnwindSafe for MatchIterator<'a, Cfg, L, S, T, P>
where &'a QueryPlan<<Cfg as EGraphConfig>::O, <Cfg as EGraphConfig>::Index, L>: UnwindSafe, &'a EGraph<Cfg, L, T, P>: UnwindSafe, &'a VariantIndex<'a, Cfg>: UnwindSafe, &'a GlobalCtx<S, <Cfg as EGraphConfig>::G>: UnwindSafe, Match<Cfg>: UnwindSafe, Vec<Frame<'a, Cfg>>: UnwindSafe,

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.