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

22
src/boxes/buffer/mod.rs Normal file
View File

@ -0,0 +1,22 @@
//! BufferBox 📊 - バイナリデータ処理
// Nyashの箱システムによるバイナリデータ処理を提供します。
// 参考: 既存Boxの設計思想
pub struct BufferBox {
pub data: Vec<u8>,
}
impl BufferBox {
pub fn new() -> Self {
BufferBox { data: Vec::new() }
}
pub fn from_vec(data: Vec<u8>) -> Self {
BufferBox { data }
}
pub fn len(&self) -> usize {
self.data.len()
}
pub fn as_slice(&self) -> &[u8] {
&self.data
}
}