Skip to main content

Crate srcdmp

Crate srcdmp 

Source
Expand description

§srcdmp

An amazing source code snapshot library and CLI tool.

srcdmp packs entire project directories into compact binary archive files (.srcdmp) using a family of specialized codecs. It provides both a command-line interface and a library API for creating, inspecting, and extracting snapshots.

§Feature Flags

  • cli (enabled by default): CLI tooling, TUI viewer, and colored output.
  • fs (enabled by default): Filesystem operations via Dump, DumpBuilder, and DumpWriteBuilder.

§Codecs

CodecIDDescription
SDMP-70x07Three-tier compression optimized for source code ASCII characters
SDMP-80x08Raw UTF-8 passthrough, no compression
SDMP-C40x04Huffman-tree-based compression using empirically derived frequencies
SDMP-C20x02Reserved for future use

§Quick Start

use srcdmp::{Dump, Codec};

let dump = Dump::from_dir(".")
    .codec(Codec::Compact4)
    .gitignore()
    .build()
    .expect("failed to build snapshot");

println!("packed {} files, {} bytes", dump.file_count(), dump.original_size());

Modules§

cli
CLI tooling: logging and TUI viewer.
raw
Raw encoding and decoding primitives.

Structs§

Dump
A compressed snapshot of a source directory.
DumpBuilder
Builder for constructing a Dump from a directory on disk.
DumpWriteBuilder
Builder for writing a Dump to a date-stamped filename.

Enums§

Codec
The compression codec used when encoding a snapshot.

Functions§

unpack_bytes
Decode a complete .srcdmp archive from an in-memory byte slice.