You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's strange not to be able to return a typed error with the BytesEncode and BytesDecode traits.
It would be nice to have something like that;
/// A trait that represents an encoding structure.pubtraitBytesEncode<'a>{typeEItem: ?Sized + 'a;typeErr;fnbytes_encode(item:&'a Self::EItem) -> Result<Cow<'a,[u8]>,Self::Err>;}/// A trait that represents a decoding structure.pubtraitBytesDecode<'a>{typeDItem:'a;typeErr;fnbytes_decode(bytes:&'a [u8]) -> Result<Self::DItem,Self::Err>;}
The text was updated successfully, but these errors were encountered:
Kerollmops
changed the title
v0.20: Type the error in the traits BytesEncode and BytesDecode
Type the error in the traits BytesEncode and BytesDecodeMar 5, 2023
It's strange not to be able to return a typed error with the
BytesEncode
andBytesDecode
traits.It would be nice to have something like that;
The text was updated successfully, but these errors were encountered: