-
We had introduced a I wanted to express this requirement by specifying a I've gone with EDIT: I think this question applies to all "abstract" |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Ideally we'd use We cannot parametrize types with values, so we're restricted to using handle types with associated tags instead. We could define more generic handles for each available tag, and |
Beta Was this translation helpful? Give feedback.
Ideally we'd use
OpTag
s as root node restrictions, but notice that tags are enum values whileNodeHandle
s are types implementing a trait.We cannot parametrize types with values, so we're restricted to using handle types with associated tags instead.
(Rust supports const generics like
Array<const N: usize>
, but it doesn't allow arbitrary enums likeOpTag
).We could define more generic handles for each available tag, and
NodeHandle::try_cast
where necessary. I just worry that the explicit calls may get annoying.