pub struct OpMeta {
pub is_constructor: bool,
pub cost: u32,
pub unextractable: bool,
}Expand description
Non-algebraic registration metadata for an operator: whether it was declared as a
constructor, and the two extraction knobs. Separate from OpKind, which carries only
the algebraic shape. The surface layer parses this straight out of a declaration’s tag
list (ast::Command::Function, ast::Variant) and hands it to
OpRegistry::register_kind_meta, so there is one representation from parse to registry.
Default is the undeclared case: a plain (function …) — not a constructor, cost 1,
extractable. Cost 1 is what the extractor charged for every node before per-op costs
existed, so a program that declares no :cost extracts exactly as it did before.
Fields§
§is_constructor: boolDeclared with (constructor …), or a (datatype …) variant. A constructor is a term
former: it behaves like a function for congruence and matching, and additionally
stamps FLAG_CONSTRUCTOR on its nodes.
cost: u32Per-node extraction cost (:cost n). The cost of a term is the sum over its nodes,
with an AC child of multiplicity k counted k times.
unextractable: bool:unextractable — the extractor never selects a node of this op.
Trait Implementations§
impl Copy for OpMeta
impl Eq for OpMeta
impl StructuralPartialEq for OpMeta
Auto Trait Implementations§
impl Freeze for OpMeta
impl RefUnwindSafe for OpMeta
impl Send for OpMeta
impl Sync for OpMeta
impl Unpin for OpMeta
impl UnsafeUnpin for OpMeta
impl UnwindSafe for OpMeta
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.