refactor(ml): move core types to ml-core + dedup MLError (5a)
Move all inline type definitions from ml/src/lib.rs to ml-core:
MLError, MLResult, Trade, MarketRegime, HealthStatus, Features,
MLModel trait, ModelRegistry, ParallelExecutor, LatencyOptimizer,
TrainingMetrics, ValidationMetrics, InferenceResult, ModelMetadata.
Dedup: consolidate ConfigError{reason}/ConfigurationError(msg) into
single ConfigError(String) tuple variant (was 2 variants, 174 refs).
Cleanup: convert create_hft_* free functions to associated methods
(HFTPerformanceProfile::ultra_low_latency(), ParallelExecutor::hft()).
ml facade re-exports via `pub use ml_core::*`.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -134,9 +134,7 @@ pub struct AlignedBuffer {
|
||||
impl AlignedBuffer {
|
||||
pub fn new(capacity: usize, alignment: usize) -> Result<Self, MLError> {
|
||||
if alignment == 0 || !alignment.is_power_of_two() {
|
||||
return Err(MLError::ConfigError {
|
||||
reason: "Alignment must be a power of two".to_owned(),
|
||||
});
|
||||
return Err(MLError::ConfigError("Alignment must be a power of two".to_owned()));
|
||||
}
|
||||
|
||||
let mut data = Vec::with_capacity(capacity + alignment);
|
||||
|
||||
Reference in New Issue
Block a user