Skip to main content

Crate argus

Crate argus 

Source
Expand description

argus-chunk — Argus watches over chunk IO.

Little-endian wire primitives, bounds-checked spans, and raw/zstd codecs shared by Tetration and Tessera. Domain layouts (superblocks, index rows, catalogs) stay in those crates.

§Scope

Argus intentionally owns only format-neutral mechanics:

  • le reads and writes fixed-width little-endian fields and validates byte spans.
  • codec implements the shared payload codec tags (0 raw, 1 zstd).
  • mmap owns a read-only memory map together with its file handle.

File magic, layout versions, superblocks, index rows, catalogs, and semantic validation belong to the consuming format crate.

§Wire example

use argus::le::{LeReader, LeWriter, align8};

assert_eq!(align8(9), 16);

let mut buf = [0u8; 16];
{
    let mut w = LeWriter::new(&mut buf);
    w.put_bytes(b"TESS");
    w.put_u32(0);
    w.put_u64(64);
}
let mut r = LeReader::new(&buf);
assert_eq!(&r.take_4(), b"TESS");
assert_eq!(r.take_u32(), 0);
assert_eq!(r.take_u64(), 64);

Re-exports§

pub use codec::CodecError;
pub use codec::PayloadCodec;
pub use codec::decode;
pub use codec::encode;
pub use le::BufferTooShort;
pub use le::LeReader;
pub use le::LeWriter;
pub use le::SpanError;
pub use le::align8;
pub use le::checked_subslice;
pub use le::checked_u64_byte_span;
pub use le::padding_to_align8;
pub use mmap::MappedFile;

Modules§

codec
Raw and zstd chunk payload encoding. Chunk payload codecs shared by Tetration and Tessera.
le
Little-endian cursors, alignment, and byte-span validation. Little-endian wire primitives and alignment helpers.
mmap
Read-only memory-mapped file ownership. Read-only memory-mapped file ownership.