API Reference
Note
API documentation will be auto-generated from Rust source code once implementation begins. This page serves as a placeholder and integration guide for future developers.
Planned Architecture
Based on Software Design Document, AirGap Transfer will consist of these modules:
CLI Module (cli)
Purpose: Command-line interface for pack/unpack/list operations
Key Components:
PackCommand- Pack operation handlerUnpackCommand- Unpack operation handlerListCommand- List operation handlerArgs- Argument parser using clap
Chunker Module (chunker)
Purpose: Split files into fixed-size chunks
Key Components:
Chunker- Main chunking logicChunkWriter- Write chunks to tar archivesStreamingReader- Memory-efficient file reading
Chunker Module — Reconstruction (chunker)
Purpose: Reconstruct files from chunks (the unpack side of chunker.rs)
Key Components:
ChunkReader- Read chunks from tar archivesStreamingWriter- Memory-efficient file reconstructionReconstruction logic shares the streaming architecture with pack operations
See SDD for the Chunker (chunker.rs) component design.
Verifier Module (verifier)
Purpose: Cryptographic integrity verification with pluggable hash backends
Key Components:
HashAlgorithm- Trait interface for pluggable hash backendsSha256Backend- Default SHA-256 implementationverify_chunk- Verify chunk checksum against manifest
See SDD for the Verifier (verifier.rs) component design.
Manifest Module (manifest)
Purpose: Manage transfer metadata and state
Key Components:
Manifest- Transfer metadata structureChunkMetadata- Individual chunk informationStateManager- Operation state persistence
USB Module (usb)
Purpose: USB device detection and management
Key Components:
UsbDetector- Detect USB drive capacityMountMonitor- Monitor mount/unmount eventsSpaceChecker- Verify available space
Developer Resources
See Rust API Documentation Integration Guide for doc comment guidelines, sphinxcontrib-rust configuration, and traceability linking.
Future Enhancements
When implementation begins:
Add
.. impl::directives for each moduleLink implementations to requirements in traceability matrix
Auto-generate API docs with sphinxcontrib-rust
Document async operation patterns
Add workflow examples with code snippets