Files
riscv64-kernel/src/virtual_fs/stdin.rs
2026-03-13 11:15:52 +01:00

68 lines
1.5 KiB
Rust

// use core::cell::RefCell;
// use alloc::boxed::Box;
// use io::{IoBase, Read, Seek, Write};
// use crate::virtual_fs::{VirtualFileSystem, VirtualNode};
// pub const STDIN_BUFFER_SIZE: usize = 4096; // 4Ko
// #[derive(Debug)]
// pub struct Stdin {
// buffer: RefCell<[u8; STDIN_BUFFER_SIZE]>,
// }
// impl Stdin {
// pub fn new() -> Self {
// Self {
// buffer: RefCell::new([0; _]),
// }
// }
// }
// #[derive(Debug)]
// pub struct StdinNode<'a> {
// stdin: &'a Stdin,
// }
// impl VirtualFileSystem for Stdin {
// fn open(
// &mut self,
// path: &bffs::path::Path,
// ) -> Result<alloc::boxed::Box<dyn crate::virtual_fs::VirtualNode + '_>, ()> {
// if !path.is_empty() {
// Err(())
// } else {
// Ok(Box::new(StdinNode { stdin: self }))
// }
// }
// }
// impl IoBase for StdinNode<'_> {
// type Error = ();
// }
// impl Read for StdinNode<'_> {
// fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> {
// todo!()
// }
// }
// impl Seek for StdinNode<'_> {
// fn seek(&mut self, pos: io::SeekFrom) -> Result<u64, Self::Error> {
// todo!()
// }
// }
// impl Write for StdinNode<'_> {
// fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> {
// todo!()
// }
// fn flush(&mut self) -> Result<(), Self::Error> {
// todo!()
// }
// }
// impl VirtualNode for StdinNode<'_> {}