Just now, we have a pattern for writing into action metadata in the slowpath:
// T: ActionMetaValue
// Layer A
let t: T = /* ... */;
meta.insert(self.target.key(), self.target.as_meta());
// ...
// Layer B
let target_str = match action_meta.get(T::KEY) { /* ... */ };
let target = match T::from_meta(target_str) { /* ... */ };
Given that KEY is static, we should be able to perform typed storage/lookup with knowledge of T without needing to specify the key and value explicitly.
There is also the construction of Predicate::Meta entries, which follows a similar manual key and value selection. A convenience method to build a predicate from an ActionMetaValue would be tidier in general.
Just now, we have a pattern for writing into action metadata in the slowpath:
Given that
KEYis static, we should be able to perform typed storage/lookup with knowledge ofTwithout needing to specify the key and value explicitly.There is also the construction of
Predicate::Metaentries, which follows a similar manual key and value selection. A convenience method to build a predicate from anActionMetaValuewould be tidier in general.