sift_core/storage/format.rs
1//! Shared magic bytes and little-endian helpers.
2
3use std::io::Write;
4
5pub const FILES_MAGIC: [u8; 8] = *b"SIFTFIL2";
6pub const LEXICON_MAGIC: [u8; 8] = *b"SIFTLEX1";
7pub const POSTINGS_MAGIC: [u8; 8] = *b"SIFTPST1";
8
9/// # Errors
10///
11/// Propagates IO errors from `w`.
12pub fn write_magic<W: Write>(w: &mut W, magic: [u8; 8]) -> std::io::Result<()> {
13 w.write_all(&magic)
14}