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

21
src/boxes/future/mod.rs Normal file
View File

@ -0,0 +1,21 @@
//! FutureBox 🔄 - 非同期処理基盤
// Nyashの箱システムによる非同期処理の基盤を提供します。
// 参考: 既存Boxの設計思想
use std::future::Future;
use std::pin::Pin;
pub struct FutureBox<T> {
pub future: Pin<Box<dyn Future<Output = T> + Send>>,
}
impl<T> FutureBox<T> {
pub fn new<F>(fut: F) -> Self
where
F: Future<Output = T> + Send + 'static,
{
FutureBox {
future: Box::pin(fut),
}
}
}