Expand description
§Infrastructure Adapters Module
This module contains concrete implementations of domain interfaces (ports), following the Hexagonal Architecture pattern. These adapters handle:
- External service integrations
- File I/O operations
- Compression algorithms
- Encryption services
- Data transformation
§Design Principles
- Dependency Inversion: Adapters depend on domain interfaces, not vice versa
- Single Responsibility: Each adapter has one clear purpose
- Testability: Adapters can be easily mocked or replaced
- Configuration: Adapters are configured through dependency injection
§Module Structure
adapters/
├── chunk_processor_adapters.rs # Chunk processing implementations
├── compression.rs # Compression service implementations
├── encryption.rs # Encryption service implementations
├── file_io.rs # File I/O service implementations
├── async_compression.rs # Async compression adapter
├── async_encryption.rs # Async encryption adapter
└── async_checksum.rs # Async checksum adapter
requires_security_context: false,
};
// Create adapter
let adapter = ServiceChunkAdapter::new(
service,
"my_service".to_string(),
config
);§Architecture Benefits
- Separation of Concerns: Services focus on business logic, adapters handle integration
- Reusability: Services can be used in multiple contexts through different adapters
- Testability: Easy to test services independently of their usage context
- Flexibility: Runtime configuration of adapter behavior
Re-exports§
pub use async_checksum::*;pub use async_compression::*;pub use async_encryption::*;pub use compression::*;pub use encryption::*;
Modules§
- async_
checksum - Async checksum adapter (wraps sync domain trait for async contexts)
- async_
compression - Async compression adapter (wraps sync domain trait for async contexts)
- async_
encryption - Async encryption adapter (wraps sync domain trait for async contexts)
- chunk_
processor_ adapters - Chunk processor adapters for service integration
- compression
- Compression service adapter
- encryption
- Encryption service adapter
- file_io
- File I/O service adapter