Trait aegir::Identifier
source · pub trait Identifier: Copy + PartialEq + Eq + Debug + Display {
fn into_var(self) -> Variable<Self> { ... }
}
Expand description
Interface for type-level identifiers.
This trait should be implemented for symbols that are used to label variable/meta nodes (see
meta). For example, one might define X
and Y
for use in regression models, or W
to
denote weights. To make life easier, we define a large set of “standard” identifiers in the
ids module.
Implementation of this trait is mostly uncomplicated, but can be cumbersome. In particular, the
VariableAdjoint type relies on PartialEq
being implemented for the
two identifiers I
and T
. The procedural macro ids! is provided to make this simpler
should you want to define a custom type.