Crate bitbottle

Crate bitbottle 

Source

Modules§

cli

Structs§

ArchiveExpander
Wrap an ArchiveReader so that it also expands the archive into a folder. Works by handling ArchiveReaderEvents as they occur, but still emitting them as it goes.
ArchiveReader
ArchiveReaderOptions
Block
Info about a data block delineated by Scanner: size and hash.
BlockData
A block’s size & hash, and the actual data.
BottleCap
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.
BottleReader
Parse a raw bitbottle from a Read byte stream and make its inner streams available as either Read (data stream) or BottleReader (bottle stream).
BottleWriter
Generate a raw bitbottle and write it into a Write downstream.
CompressedBottleReader
Given a BottleReader for a bottle of type Compressed, decompress the inner data bottle and provide it in the form of a Read.
CompressedBottleWriter
A Write that writes all data into a bottle of type Compressed.
CountingReader
Wrap a Read and count the bytes read.
CountingWriter
Wrap a Write and count the bytes written.
CreateArchiveOptions
Specify any compression or encryption you want around a bitbottle file archive, as well as details like hashing algorithm and buzscan parameters.
Ed25519PublicKey
Ed25519SecretKey
EncryptedBottleInfo
EncryptedBottleReader
EncryptedBottleWriter
EncryptedBottleWriterOptions
FileAtlas
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.
FileList
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.
FileListBottleReader
FileListBottleWriter
FileScanner
Wrap Scanner to traverse recursively through a list of paths, scan each file to figure out block boundaries, and generate a FileList.
Scanner
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§

ArchiveReaderEvent
BottleError
BottleStream
BottleType
Names for the bottle_type: u8 field in BottleCap.
CompressionAlgorithm
CreateArchiveState
Which stage of building an archive are we at?
EncryptionAlgorithm
EncryptionKey
HashType
Hashing
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.
ScanState
FileScanner progress: scanning paths or blocks.

Traits§

BottlePublicKey
BottleSecretKey

Functions§

create_archive
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.
drain_stream
Read and discard data from an io::Read. Returns the size of the stream, and if the size was less than max_capture bytes, also returns the data from the stream.
get_feature_list
is_bottle
Given a buffer of the first (at least 5) bytes of a stream, is this a bottle?

Type Aliases§

BottleResult
FileAtlasRef
Shared reference to a FileAtlas.
FileListRef
Shared reference to a FileList.
SimpleArchiveExpander