use super::fs;
use super::net;
use alloc::sync::Arc;
use crate::{
runtime::{self as rt, SharedTask},
sync::q::Queue,
};
pub struct Share {
tasks: Queue<SharedTask>,
}
impl rt::Share for Share {
fn spawn<F, R>(&self, future: F) -> rt::Join<R>
where
F: Future<Output = R> + Send + 'static,
R: Send + 'static,
{
todo!()
}
}
pub struct Runtime {
share: Arc<Share>,
}
impl rt::Runtime<Share> for Runtime {
type TcpStream = net::tcp::Stream;
type TcpListener = net::tcp::Listener;
type UdpSocket = net::udp::Socket;
type UdpEndpoint = net::udp::Endpoint;
type File = fs::file::File;
type FileSystem = fs::FileSystem;
fn share(&self) -> &Share {
&*self.share
}
fn spawn_local<F, R>(&self, future: F) -> rt::Join<R>
where
F: Future<Output = R> + 'static,
R: 'static,
{
todo!()
}
fn block_on<F>(&self, future: F) -> F::Output
where
F: Future,
{
todo!()
}
fn for_platform() -> Self
where
Self: Sized,
{
todo!()
}
}