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

Implement convenience traits for encoded types #597

Merged
merged 2 commits into from
Nov 20, 2023

Conversation

george-hopkins
Copy link
Contributor

Implement From<T> and Debug for Base64<T>, Json<T>, Msgpack<T> and Protobuf<T>

Copy link
Contributor

@zshipko zshipko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This is great as-is but I wonder if it makes sense to implement From<Json<T>> for T for encoding types also?

@george-hopkins
Copy link
Contributor Author

Unfortunately, we can't implement From<Json<T>> on foreign types. We could implement Into<T> for Json<T> but this would prevent users from implementing From<Json<T>> themselves.

@zshipko zshipko merged commit 97f4dea into extism:main Nov 20, 2023
6 checks passed
@george-hopkins george-hopkins deleted the convert branch November 21, 2023 14:46
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.

None yet

2 participants