pub enum FusionPattern {
Node {
op: &'static str,
inputs: Vec<FusionPattern>,
bind: Cow<'static, str>,
},
Any {
bind: Cow<'static, str>,
},
VariadicNode {
op: &'static str,
child_pattern: Box<FusionPattern>,
bind: Cow<'static, str>,
min_children: usize,
},
}Expand description
A structural pattern that matches a subgraph of the Polydat DAG.
Patterns are trees — each sub-pattern matches exactly one node. Diamond shapes (two pattern leaves matching the same upstream node) are handled by bind-name equality checks after matching.
Variants§
Node
Match a node by its meta().name string.
Sub-patterns match the node’s inputs (respecting the node’s
declared commutativity). The node’s jit_constants() are
captured under bind.
Fields
inputs: Vec<FusionPattern>Sub-patterns for the node’s inputs.
Any
Match any wire source (coordinate, upstream node output, etc.). This is the “hole” — it captures the wire reference for rewiring to the fused replacement node.
VariadicNode
Match a variadic node with N children, applying a sub-pattern
to each child. Children are bound as {bind}_0, {bind}_1, etc.
Use for fusion rules that operate on variadic nodes like sum
where the number of inputs isn’t known at rule-definition time.
Implementations§
Trait Implementations§
Source§impl Clone for FusionPattern
impl Clone for FusionPattern
Source§fn clone(&self) -> FusionPattern
fn clone(&self) -> FusionPattern
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FusionPattern
impl RefUnwindSafe for FusionPattern
impl Send for FusionPattern
impl Sync for FusionPattern
impl Unpin for FusionPattern
impl UnsafeUnpin for FusionPattern
impl UnwindSafe for FusionPattern
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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