pub struct FusionRule {
pub name: &'static str,
pub pattern: FusionPattern,
pub replacement: fn(&MatchResult) -> Box<dyn PolydatNode>,
pub input_bindings: &'static [&'static str],
}Expand description
A graph rewrite rule: a subgraph pattern and its replacement.
Each rule is a declarative specification. The pattern describes
what to match; the replacement factory produces the fused node;
input_bindings maps the fused node’s input ports to captured
wire sources by name.
Fields§
§name: &'static strHuman-readable name for diagnostics, logging, and test output.
pattern: FusionPatternThe subgraph pattern to match.
replacement: fn(&MatchResult) -> Box<dyn PolydatNode>Factory: given the match result, produce the replacement fused node.
input_bindings: &'static [&'static str]Binding names for the fused node’s inputs, in order.
Each name must correspond to an Any leaf in the pattern.
Auto Trait Implementations§
impl Freeze for FusionRule
impl RefUnwindSafe for FusionRule
impl Send for FusionRule
impl Sync for FusionRule
impl Unpin for FusionRule
impl UnsafeUnpin for FusionRule
impl UnwindSafe for FusionRule
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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