Encodes a value of a particular fixed width type into bytes according to the rules described on [`super::RowConverter`]
| 45 | /// Encodes a value of a particular fixed width type into bytes according to the rules |
| 46 | /// described on [`super::RowConverter`] |
| 47 | pub trait FixedLengthEncoding: Copy { |
| 48 | const ENCODED_LEN: usize = 1 + std::mem::size_of::<Self::Encoded>(); |
| 49 | |
| 50 | type Encoded: Sized + Copy + FromSlice + AsRef<[u8]> + AsMut<[u8]>; |
| 51 | |
| 52 | fn encode(self) -> Self::Encoded; |
| 53 | |
| 54 | fn decode(encoded: Self::Encoded) -> Self; |
| 55 | } |
| 56 | |
| 57 | impl FixedLengthEncoding for bool { |
| 58 | type Encoded = [u8; 1]; |
nothing calls this directly
no outgoing calls
no test coverage detected