Add core Box implementations: ArrayBox, ResultBox, FutureBox, BufferBox, FileBox, JSONBox, HttpClientBox, StreamBox, RegexBox

This commit is contained in:
moe-charm
2025-08-10 02:45:57 +00:00
parent ccb3204a35
commit 6f916855c8
9 changed files with 207 additions and 0 deletions

19
src/boxes/json/mod.rs Normal file
View File

@ -0,0 +1,19 @@
//! JSONBox 📋 - JSON解析・生成
// Nyashの箱システムによるJSON解析・生成を提供します。
// 参考: 既存Boxの設計思想
use serde_json::{Value, Error};
pub struct JSONBox {
pub value: Value,
}
impl JSONBox {
pub fn from_str(s: &str) -> Result<Self, Error> {
let value = serde_json::from_str(s)?;
Ok(JSONBox { value })
}
pub fn to_string(&self) -> String {
self.value.to_string()
}
}