Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor access to header properties #4

Merged
merged 4 commits into from
Nov 23, 2023
Merged

Conversation

alexrudy
Copy link
Owner

Put all properties behind accessor structs with methods that return references. This allows us to show a uniform interface, but always expose type-correct headers.

Stop exposing registered fields directly as strucutres - since there are registered fields stored on the HeaderState type as well (to track registered fields which can be key dependent). Access is replaced with accessor structs which allow access to all header fields in both shared and mutable reference forms. The access structs depend on the header state, and so can always return the correct types.

Also refactors header documentation to be in markdown files alongside the source, so that header documentation can be easily re-used without copy and paste.
@alexrudy alexrudy merged commit fdf23b7 into main Nov 23, 2023
5 checks passed
@alexrudy alexrudy deleted the header-access-refactor branch November 24, 2023 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant