-
Notifications
You must be signed in to change notification settings - Fork 731
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement dynamic metadata injection
Now that places are using non-'static metadata, we can overlay a patched view of the metadata. Using the strategy seen in tracing-log, we recognize specifically named metadata/fields and use the values they provide to create metadata with the resolved runtime values. Importantly, we also strive to only expose dynamic injection fields when explicitly asked for. This means that most code can continue on without knowing that these fields even exist. Applying these patches does have a cost; notably, things which used to deal in references like &Metadata or &FieldSet now often use an owned, patched version instead. These types are primarily bags of references themselves, and no copying of actual data is involved, but the fact that the bags of references (which aren't exactly tiny) are copied does have an impact. More places which don't have to deal with metadata patching (e.g. the macro support code) should be audited for what can use the _prenormal versions of methods. Additionally, there are likely places where the magic fields leak out without being explicitly asked for. Ideally, these are all bugs which can be fixed. There aren't really any tests that effectively check for this, so new tests will need to be written. Finaly, there's the question of actually dispatching such a dynamic event. tracing-log is an example of doing so (but uses touchy, hidden API to construct the ValueSet) (implemented in the next commit), but a generally applicable is likely desirable. This will probably take the shape of dynamic_span! and dynamic_event! macros in tracing proper.
- Loading branch information
Showing
20 changed files
with
848 additions
and
92 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.