pub struct VirtualIo {
pub args: Vec<String>,
pub fs: RefCell<FileSystem>,
pub stdout: VecRef,
pub duration: RefCell<Duration>,
}
Fields§
§args: Vec<String>
§fs: RefCell<FileSystem>
§stdout: VecRef
§duration: RefCell<Duration>
Implementations§
Trait Implementations§
source§impl Io for VirtualIo
impl Io for VirtualIo
type File = MemFile
type Stdout = VecRef
type Args = IntoIter<String>
type Metadata = Metadata
type DirEntry = DirEntry
type Instant = Duration
fn args(&self) -> Self::Args
fn metadata(&self, path: &str) -> Result<Metadata>
fn create(&self, path: &str) -> Result<Self::File>
fn create_dir(&self, path: &str) -> Result<()>
fn open(&self, path: &str) -> Result<Self::File>
fn stdout(&self) -> VecRef ⓘ
fn read_dir(&self, path: &str) -> Result<Vec<DirEntry>>
fn now(&self) -> Self::Instant
fn current_dir(&self) -> Result<String>
fn set_current_dir(&self, path: &str) -> Result<()>
fn read(&self, path: &str) -> Result<Vec<u8>, Error>
fn read_to_string(&self, path: &str) -> Result<String, Error>
fn write(&self, path: &str, data: &[u8]) -> Result<(), Error>
fn create_dir_recursively(&self, path: &str) -> Result<(), Error>
fn write_recursively(&self, path: &str, data: &[u8]) -> Result<(), Error>
fn read_dir_type( &self, path: &str, is_dir: bool ) -> Result<Vec<Self::DirEntry>, Error>
Auto Trait Implementations§
impl !Freeze for VirtualIo
impl !RefUnwindSafe for VirtualIo
impl !Send for VirtualIo
impl !Sync for VirtualIo
impl Unpin for VirtualIo
impl !UnwindSafe for VirtualIo
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more