Support creating a `Ref` of a type that implements `TryFromBytes`
Open
- Dominant language
- Rust
- Stars
- 2.6k
- Forks
- 179
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 29
Description
Support fallible constructors on `Ref` for types that implement `TryFromBytes`
For example, would like to be able to do something like the following:
```rust
#[derive(TryFromBytes)]
#[repr(u8)]
enum MyEnum {
V0 = 0,
V1 = 1,
}
let (enum_ref, remainder) = Ref::::try_from_prefix(bytes)?;
```
Contributor guide
Assessment
This issue has not been assessed yet.