Check whether `buf` has a valid sidecar index appended.
(buf: &[u8])
| 48 | |
| 49 | /// Check whether `buf` has a valid sidecar index appended. |
| 50 | pub fn has_sidecar(buf: &[u8]) -> bool { |
| 51 | if buf.len() < TRAILER_SIZE { |
| 52 | return false; |
| 53 | } |
| 54 | let magic_start = buf.len() - 4; |
| 55 | buf[magic_start..] == SIDECAR_MAGIC_LE |
| 56 | } |
| 57 | |
| 58 | /// Return the raw msgpack slice from a buffer that may or may not have a sidecar. |
| 59 | /// |
no test coverage detected