Skip to content

Conversation

@vrobweis
Copy link
Contributor

Adding a file with support for strongly typed IDs for the Book, Chapter, and Content structs.

Each ID struct contains a simple primitive, increasing in size so that the Chapter ID can be half its own ID, and half its Book's ID. This limits the potential number of IDs, but not by enough for it to be a problem for this app. (The user can still have up to 255 books on the app with this system.

More importantly, each struct has an ID marker trait, implemented generically, and ChapterID and ContentID implement CompositeID, so that this functionality could be extended to a different implementation, such as larger primitives or use an array of primitives.

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