Skip to content

ActionMeta could allow direct storage/retrieval of an ActionMetaValue #703

@FelixMcFelix

Description

@FelixMcFelix

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.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Enhancement.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions