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 TryFromBytes trait #641

Merged
merged 1 commit into from
Nov 27, 2023
Merged

Add TryFromBytes trait #641

merged 1 commit into from
Nov 27, 2023

Conversation

joshlf
Copy link
Member

@joshlf joshlf commented Nov 26, 2023

TryFromBytes can be implemented for types which are not FromZeroes or FromBytes; it supports performing a runtime check to determine whether a given byte sequence contains a valid instance of Self.

This is the first step of #5, and only adds support for some internals. Future commits will add a richer public API, implementations of TryFromBytes for built-in types, support for a custom derive, and support for implementing TryFromBytes on unsized types.

Makes progress on #5

`TryFromBytes` can be implemented for types which are not `FromZeroes`
or `FromBytes`; it supports performing a runtime check to determine
whether a given byte sequence contains a valid instance of `Self`.

This is the first step of #5, and only adds support for some internals.
Future commits will add a richer public API, implementations of
`TryFromBytes` for built-in types, support for a custom derive, and
support for implementing `TryFromBytes` on unsized types.

Makes progress on #5
@joshlf joshlf added this pull request to the merge queue Nov 27, 2023
Merged via the queue into main with commit e3be230 Nov 27, 2023
126 checks passed
@joshlf joshlf deleted the try-from-bytes-trait branch November 27, 2023 17:19
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