feat(phase90): Ring0Context fs/time/thread migration complete
Phase 90 完了: IO/fs/time/thread 系の Ring0 移行 **Phase 90-A: fs 系移行(7箇所)** - FsApi trait 追加(6メソッド) - StdFs 実装(std::fs ベース) - IoError 拡張(4バリアント追加) - 移行: strip.rs(4), dispatch.rs(1), mod.rs(3) **Phase 90-B: io 系移行** - Phase 88 完了済み(スキップ) **Phase 90-C: time 系移行(3箇所)** - TimeApi に elapsed() 追加 - 移行: selfhost_exe.rs(1), io.rs(1), plugin_loader_unified.rs(1) **Phase 90-D: thread 系移行(2箇所)** - ThreadApi trait 追加(sleep メソッド) - StdThread 実装 - 移行: global_hooks.rs(1), plugin_loader_unified.rs(1) **Phase 90-E: 統合テスト** - ビルド成功(6 warnings, 0 errors) - テスト: 522/554 passed (94.2%) - 退行なし **実装成果**: - Ring0Context 拡張: fs, thread フィールド追加 - 総移行: 12箇所(fs: 7, time: 3, thread: 2) - 移行率: fs(2.9%), time(2.1%), thread(5.4%) **次のステップ**: Phase 91 (PluginHost/CoreServices skeleton) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -7,8 +7,10 @@ mod std_impls;
|
||||
mod traits;
|
||||
|
||||
pub use errors::{IoError, TimeError};
|
||||
pub use std_impls::{NoopMem, StdIo, StdLog, StdTime};
|
||||
pub use traits::{IoApi, LogApi, LogLevel, MemApi, MemStats, TimeApi};
|
||||
pub use std_impls::{NoopMem, StdFs, StdIo, StdLog, StdThread, StdTime};
|
||||
pub use traits::{
|
||||
FsApi, FsMetadata, IoApi, LogApi, LogLevel, MemApi, MemStats, ThreadApi, TimeApi,
|
||||
};
|
||||
|
||||
use std::sync::{Arc, OnceLock};
|
||||
|
||||
@ -20,6 +22,8 @@ pub struct Ring0Context {
|
||||
pub io: Arc<dyn IoApi>,
|
||||
pub time: Arc<dyn TimeApi>,
|
||||
pub log: Arc<dyn LogApi>,
|
||||
pub fs: Arc<dyn FsApi>, // Phase 90-A
|
||||
pub thread: Arc<dyn ThreadApi>, // Phase 90-D
|
||||
}
|
||||
|
||||
impl Ring0Context {
|
||||
@ -29,8 +33,17 @@ impl Ring0Context {
|
||||
io: Arc<dyn IoApi>,
|
||||
time: Arc<dyn TimeApi>,
|
||||
log: Arc<dyn LogApi>,
|
||||
fs: Arc<dyn FsApi>,
|
||||
thread: Arc<dyn ThreadApi>,
|
||||
) -> Self {
|
||||
Self { mem, io, time, log }
|
||||
Self {
|
||||
mem,
|
||||
io,
|
||||
time,
|
||||
log,
|
||||
fs,
|
||||
thread,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,6 +54,8 @@ impl std::fmt::Debug for Ring0Context {
|
||||
.field("io", &"<dyn IoApi>")
|
||||
.field("time", &"<dyn TimeApi>")
|
||||
.field("log", &"<dyn LogApi>")
|
||||
.field("fs", &"<dyn FsApi>")
|
||||
.field("thread", &"<dyn ThreadApi>")
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
@ -52,6 +67,8 @@ pub fn default_ring0() -> Ring0Context {
|
||||
io: Arc::new(StdIo),
|
||||
time: Arc::new(StdTime),
|
||||
log: Arc::new(StdLog),
|
||||
fs: Arc::new(StdFs),
|
||||
thread: Arc::new(StdThread),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user