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

Add IsIdentifiableVecOfVia trait and newtype_identified_vec macro #9

Merged
merged 25 commits into from
Dec 16, 2023

Conversation

Sajjon
Copy link
Owner

@Sajjon Sajjon commented Dec 16, 2023

Big PR adding powerful features, that allows you to create a new type using the newtype_identified_vec macro.

You use it like so:

newtype_identified_vec!(of: User, named: Users);

It creates this:

#[derive(Debug, Clone, Eq, PartialEq)]
pub struct Users(IdentifiedVecOf<User>)

impl IsIdentifiableVecOfVia<User> for Users { ... }

The trait IsIdentifiableVecOfVia is also new, which inherits from IsIdentifiableVec - also a new trait to where all previous methods (well almost all, except a few... might do them later) and functions are moved - the IsIdentifiableVecOfVia trait allows a type to act as if it is IsIdentifiableVec via a field it has.

@Sajjon Sajjon merged commit 64cf8a4 into main Dec 16, 2023
3 checks passed
@Sajjon Sajjon deleted the is_id_vec branch December 16, 2023 20:18
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