Read [`Self::LEN`] bytes from `reader` and interpret them as the "header" of a [`Commit`]. Returns `None` if: - The reader cannot provide exactly [`Self::LEN`] bytes I.e. it is at EOF - Or, the read bytes are all zeroes This is to allow preallocation of segments.
(reader: R)
| 44 | /// This is to allow preallocation of segments. |
| 45 | /// |
| 46 | pub fn decode<R: Read>(reader: R) -> io::Result<Option<Self>> { |
| 47 | Self::decode_v1(reader) |
| 48 | } |
| 49 | |
| 50 | fn decode_internal<R: Read>(reader: R, v: Version) -> io::Result<Option<Self>> { |
| 51 | use Version::*; |