mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-27 15:41:33 +00:00
merge and respond to feedback
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
use crate::vfs::file_like::{FileLike, Metadata};
|
||||
use failure::Error;
|
||||
use std::io;
|
||||
use std::io::{Read, Write};
|
||||
use std::io::{Seek, Write};
|
||||
|
||||
pub struct Stdin;
|
||||
pub struct Stdout;
|
||||
@ -15,10 +15,18 @@ impl FileLike for Stdin {
|
||||
fn write_file(&mut self, _buf: &[u8], _offset: usize) -> Result<usize, io::Error> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
fn read_file(&mut self, _buf: &mut [u8], _offset: usize) -> Result<usize, io::Error> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
fn set_file_len(&mut self, _len: usize) -> Result<(), failure::Error> {
|
||||
panic!("Cannot set length of stdin");
|
||||
}
|
||||
}
|
||||
|
||||
impl Read for Stdin {
|
||||
fn read(&mut self, _buf: &mut [u8]) -> Result<usize, io::Error> {
|
||||
impl io::Seek for Stdin {
|
||||
fn seek(&mut self, _pos: io::SeekFrom) -> Result<u64, io::Error> {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
@ -33,10 +41,19 @@ impl FileLike for Stdout {
|
||||
let mut handle = stdout.lock();
|
||||
handle.write(buf)
|
||||
}
|
||||
|
||||
fn read_file(&mut self, _buf: &mut [u8], _offset: usize) -> Result<usize, io::Error> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
fn set_file_len(&mut self, _len: usize) -> Result<(), failure::Error> {
|
||||
panic!("Cannot set length of stdout");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
impl Read for Stdout {
|
||||
fn read(&mut self, _buf: &mut [u8]) -> Result<usize, io::Error> {
|
||||
impl io::Seek for Stdout {
|
||||
fn seek(&mut self, _pos: io::SeekFrom) -> Result<u64, io::Error> {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
@ -51,10 +68,18 @@ impl FileLike for Stderr {
|
||||
let mut handle = stderr.lock();
|
||||
handle.write(buf)
|
||||
}
|
||||
|
||||
fn read_file(&mut self, _buf: &mut [u8], _offset: usize) -> Result<usize, io::Error> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
fn set_file_len(&mut self, _len: usize) -> Result<(), failure::Error> {
|
||||
panic!("Cannot set length of stderr");
|
||||
}
|
||||
}
|
||||
|
||||
impl Read for Stderr {
|
||||
fn read(&mut self, _buf: &mut [u8]) -> Result<usize, io::Error> {
|
||||
impl io::Seek for Stderr {
|
||||
fn seek(&mut self, _pos: io::SeekFrom) -> Result<u64, io::Error> {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user