Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Allow container types in Variant #650

Closed
wants to merge 2 commits into from
Closed

Conversation

zeenix
Copy link
Contributor

@zeenix zeenix commented Jun 5, 2020

This PR allows generic container types to be used with Variant API w/o breaking the API.

Currently Variant API is limited to StaticVariantType, that can only be
implemented by types with static+fixed signatures. This will not work
for generic container types, where the signature is dependent on the child
type.

This patch adds a new trait that allows the type signature to be created
dynamically. Blanket implementation is provided for common container
types in Rust.
This will allow for container types to be used with the Variant API.
Since all StaticVariantType are also DynamicVariantType, this change
is not an API break.
src/variant.rs Show resolved Hide resolved
src/variant.rs Show resolved Hide resolved
@sdroege
Copy link
Member

sdroege commented Jun 5, 2020

w/o breaking the API.

Not breaking API is not a goal by itself :) If the API becomes weird otherwise let's rather break API. Here it seems like replacing the existing trait with something more generic would lead to better and less confusing API.

@zeenix
Copy link
Contributor Author

zeenix commented Jun 5, 2020

Closing this in favour of #651

@zeenix zeenix closed this Jun 5, 2020
@zeenix zeenix deleted the fix-variant branch June 5, 2020 20:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants