Crate bitbottle[][src]

Modules

Structs

Info about a data block delineated by Scanner: size and hash.

A block’s size & hash, and the actual data.

The bottle cap introduces a new bottle. It’s a 12-byte struct that’s followed by a (possibly zero-length) header and zero or more streams.

Parse a raw bitbottle from a Read byte stream and make its inner streams available as either Read (data stream) or BottleReader (bottle stream).

Generate a raw bitbottle and write it into a Write downstream.

Given a BottleReader for a bottle of type Compressed, decompress the inner data bottle and provide it in the form of a Read.

A Write that writes all data into a bottle of type Compressed.

Wrap a Read and count the bytes read.

Wrap a Write and count the bytes written.

Specify any compression or encryption you want around a bitbottle file archive, as well as details like hashing algorithm and buzscan parameters.

Metadata about a file (path, size, permissions, timestamps, ownership), its overall hash, and a list of the blocks that make up the file’s content.

List of files and their metadata (including block hashes). It also includes a table of the unique blocks, to easily determine the overall archive size.

Wrap Scanner to traverse recursively through a list of paths, scan each file to figure out block boundaries, and generate a FileList.

An engine that hashes data, looking for good split points. When it finds a split point, it emits the length of the block and its hash (SHA-256, Blake2, or Blake3).

Enums

Names for the bottle_type: u8 field in BottleCap.

Which stage of building an archive are we at?

Pick your poison for secure hashing. The blake3 variant stores like 2KB on the stack, but it’s only created by the file scanner, which would need to create it anyway.

Which stage of reading or expanding an archive are we at?

FileScanner progress: scanning paths or blocks.

Traits

Functions

Given paths to scan, a Writer to write to, write an entire file archive, optionally with compression and/or encryption. This is the top-level API for creating bitbottle archives.

Given a buffer of the first (at least 5) bytes of a stream, is this a bottle?

Read the archive’s file list, but don’t expand the files.

Type Definitions

Shared reference to a FileAtlas.