2025-08-09 16:12:14 +09:00
|
|
|
/*!
|
|
|
|
|
* Box Methods Module Organization
|
|
|
|
|
*
|
|
|
|
|
* 旧box_methods.rsを機能別に分割したモジュール群
|
|
|
|
|
* 保守性と可読性の向上を目的とした再構成
|
|
|
|
|
*
|
|
|
|
|
* Current implementation:
|
|
|
|
|
* - basic_methods: StringBox, IntegerBox, BoolBox, FloatBox
|
|
|
|
|
* - collection_methods: ArrayBox, MapBox
|
|
|
|
|
* - io_methods: FileBox, ResultBox ✅ IMPLEMENTED
|
|
|
|
|
* Future modules (planned):
|
|
|
|
|
* - system_methods: TimeBox, DateTimeBox, TimerBox, DebugBox
|
|
|
|
|
* - math_methods: MathBox, RandomBox
|
|
|
|
|
* - async_methods: FutureBox, ChannelBox
|
|
|
|
|
* - web_methods: WebDisplayBox, WebConsoleBox, WebCanvasBox
|
|
|
|
|
* - special_methods: MethodBox, SoundBox
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
pub mod basic_methods; // StringBox, IntegerBox, BoolBox, FloatBox
|
|
|
|
|
pub mod collection_methods; // ArrayBox, MapBox
|
|
|
|
|
pub mod io_methods; // FileBox, ResultBox
|
🔧 refactor: すべてのBoxをArc<Mutex>パターンで統一
CopilotのBox実装を私たちのArc<Mutex>パターンで統一:
- BufferBox: Arc<Mutex<Vec<u8>>>で内部可変性を実現
- FileBox: Arc<Mutex<File>>でファイルハンドル管理
- JSONBox: Arc<Mutex<Value>>でJSON値を保持
- HttpClientBox: Arc<Mutex<Client>>でHTTPクライアント管理
- StreamBox: Arc<Mutex>でストリームバッファと位置を管理
- RegexBox: Arc<Regex>で軽量ラッパー実装
各Boxに実用的なメソッドも追加:
- BufferBox: write, read, readAll, clear, length, append, slice
- FileBox: read, write, exists, delete, copy
- JSONBox: parse, stringify, get, set, has, keys
- HttpClientBox: get, post, put, delete, request
- StreamBox: write, read, position, length, reset
- RegexBox: test, find, findAll, replace, split
interpreterに新Box用のメソッド実行を追加:
- data_methods.rs: BufferBox, JSONBox, RegexBox
- network_methods.rs: HttpClientBox, StreamBox
これでコードベース全体が一貫性のあるArc<Mutex>パターンで統一されました!
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-10 13:03:42 +09:00
|
|
|
pub mod data_methods; // BufferBox, JSONBox, RegexBox
|
|
|
|
|
pub mod network_methods; // HttpClientBox, StreamBox
|
2025-08-11 05:11:52 +09:00
|
|
|
pub mod p2p_methods; // IntentBox, P2PBox
|
2025-08-14 06:10:52 +00:00
|
|
|
pub mod http_methods; // SocketBox, HTTPServerBox, HTTPRequestBox, HTTPResponseBox
|
2025-08-09 16:12:14 +09:00
|
|
|
|
|
|
|
|
// Re-export methods for easy access
|