pub struct InMemorySys(/* private fields */);Expand description
An in-memory system implementation useful for testing.
This is extremely untested and sloppily implemented. Use with extreme caution and only for testing. You will encounter bugs. Please submit fixes. I implemented this lazily and quickly.
Implementations§
Source§impl InMemorySys
impl InMemorySys
pub fn set_seed(&self, seed: Option<u64>)
pub fn set_time(&self, time: Option<SystemTime>)
Sourcepub fn disable_thread_sleep(&self)
pub fn disable_thread_sleep(&self)
Makes thread sleeping a no-op.
pub fn fs_insert(&self, path: impl AsRef<Path>, data: impl AsRef<[u8]>)
Sourcepub fn fs_insert_json(&self, path: impl AsRef<Path>, json: Value)
pub fn fs_insert_json(&self, path: impl AsRef<Path>, json: Value)
Helper method for inserting json into the in-memory file system.
Trait Implementations§
Source§impl BaseFsMetadata for InMemorySys
impl BaseFsMetadata for InMemorySys
Source§impl BaseFsOpen for InMemorySys
impl BaseFsOpen for InMemorySys
type File = InMemoryFile
Source§impl BaseFsReadDir for InMemorySys
impl BaseFsReadDir for InMemorySys
type ReadDirEntry = InMemoryDirEntry
Source§impl Clone for InMemorySys
impl Clone for InMemorySys
Source§fn clone(&self) -> InMemorySys
fn clone(&self) -> InMemorySys
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InMemorySys
impl Debug for InMemorySys
Source§impl Default for InMemorySys
impl Default for InMemorySys
Source§impl EnvCacheDir for InMemorySys
impl EnvCacheDir for InMemorySys
fn env_cache_dir(&self) -> Option<PathBuf>
Source§impl EnvCurrentDir for InMemorySys
impl EnvCurrentDir for InMemorySys
fn env_current_dir(&self) -> Result<PathBuf>
Source§impl EnvHomeDir for InMemorySys
impl EnvHomeDir for InMemorySys
fn env_home_dir(&self) -> Option<PathBuf>
Source§impl EnvSetUmask for InMemorySys
impl EnvSetUmask for InMemorySys
Source§impl EnvTempDir for InMemorySys
impl EnvTempDir for InMemorySys
fn env_temp_dir(&self) -> Result<PathBuf>
Source§impl SystemRandom for InMemorySys
impl SystemRandom for InMemorySys
Source§impl SystemTimeNow for InMemorySys
impl SystemTimeNow for InMemorySys
fn sys_time_now(&self) -> SystemTime
Source§impl ThreadSleep for InMemorySys
impl ThreadSleep for InMemorySys
fn thread_sleep(&self, dur: Duration)
impl BaseEnvSetCurrentDir for InMemorySys
impl BaseEnvSetVar for InMemorySys
impl BaseEnvVar for InMemorySys
impl BaseFsCanonicalize for InMemorySys
impl BaseFsChown for InMemorySys
impl BaseFsCloneFile for InMemorySys
impl BaseFsCopy for InMemorySys
impl BaseFsCreateDir for InMemorySys
impl BaseFsHardLink for InMemorySys
impl BaseFsRead for InMemorySys
impl BaseFsReadLink for InMemorySys
impl BaseFsRemoveDir for InMemorySys
impl BaseFsRemoveDirAll for InMemorySys
impl BaseFsRemoveFile for InMemorySys
impl BaseFsRename for InMemorySys
impl BaseFsSetFileTimes for InMemorySys
impl BaseFsSetPermissions for InMemorySys
impl BaseFsSetSymlinkFileTimes for InMemorySys
impl BaseFsSymlinkChown for InMemorySys
impl BaseFsSymlinkDir for InMemorySys
impl BaseFsSymlinkFile for InMemorySys
impl BaseFsWrite for InMemorySys
Auto Trait Implementations§
impl Freeze for InMemorySys
impl !RefUnwindSafe for InMemorySys
impl Send for InMemorySys
impl Sync for InMemorySys
impl Unpin for InMemorySys
impl !UnwindSafe for InMemorySys
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