Expand description
§Platform Abstraction Module
This module provides platform-specific abstractions for operating system functionality, following the pattern used in the Ada project.
§Architecture Pattern
Following hexagonal architecture principles:
- Interface:
Platformtrait defines the contract - Implementations:
UnixPlatform: POSIX implementation (Linux + macOS)WindowsPlatform: Windows API implementation
- Selection: Compile-time platform selection via
#[cfg]
§Design Philosophy
The bootstrap module sits OUTSIDE the enterprise application layers, so it can access platform-specific APIs directly. This abstraction:
- Isolates OS-specific code to one module
- Enables testing via trait mocking
- Provides consistent API across platforms
- Avoids scattered conditional compilation
§Usage
use adaptive_pipeline_bootstrap::platform::create_platform;
let platform = create_platform();
println!("Running on: {}", platform.platform_name());
println!("CPU cores: {}", platform.cpu_count());Structs§
- Unix
Platform - Unix (POSIX) platform implementation
Enums§
- Platform
Error - Platform-specific errors
Traits§
- Platform
- Platform abstraction trait for OS-specific operations
Functions§
- create_
platform - Create the platform-specific implementation