pub struct InMemorySystem { /* private fields */ }Implementations§
Source§impl InMemorySystem
impl InMemorySystem
pub fn from_memory_fs(memory_fs: MemoryFileSystem) -> Self
pub fn fs(&self) -> &MemoryFileSystem
pub fn set_user_configuration_directory(&self, directory: Option<SystemPathBuf>)
Trait Implementations§
Source§impl Clone for InMemorySystem
impl Clone for InMemorySystem
Source§fn clone(&self) -> InMemorySystem
fn clone(&self) -> InMemorySystem
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 InMemorySystem
impl Debug for InMemorySystem
Source§impl Default for InMemorySystem
impl Default for InMemorySystem
Source§fn default() -> InMemorySystem
fn default() -> InMemorySystem
Returns the “default value” for a type. Read more
Source§impl System for InMemorySystem
impl System for InMemorySystem
Source§fn path_metadata(&self, path: &SystemPath) -> Result<Metadata>
fn path_metadata(&self, path: &SystemPath) -> Result<Metadata>
Reads the metadata of the file or directory at
path. Read moreSource§fn canonicalize_path(&self, path: &SystemPath) -> Result<SystemPathBuf>
fn canonicalize_path(&self, path: &SystemPath) -> Result<SystemPathBuf>
Returns the canonical, absolute form of a path with all intermediate components normalized
and symbolic links resolved. Read more
Source§fn is_same_file(&self, first: &SystemPath, second: &SystemPath) -> Result<bool>
fn is_same_file(&self, first: &SystemPath, second: &SystemPath) -> Result<bool>
Returns
true if both paths refer to the same file.Source§fn read_to_string(&self, path: &SystemPath) -> Result<String>
fn read_to_string(&self, path: &SystemPath) -> Result<String>
Reads the content of the file at
path into a String.Source§fn read_to_notebook(&self, path: &SystemPath) -> Result<Notebook, NotebookError>
fn read_to_notebook(&self, path: &SystemPath) -> Result<Notebook, NotebookError>
Reads the content of the file at
path as a Notebook. Read moreSource§fn read_virtual_path_to_string(
&self,
path: &SystemVirtualPath,
) -> Result<String>
fn read_virtual_path_to_string( &self, path: &SystemVirtualPath, ) -> Result<String>
Reads the content of the virtual file at
path into a String.Source§fn read_virtual_path_to_notebook(
&self,
path: &SystemVirtualPath,
) -> Result<Notebook, NotebookError>
fn read_virtual_path_to_notebook( &self, path: &SystemVirtualPath, ) -> Result<Notebook, NotebookError>
Reads the content of the virtual file at
path as a Notebook.Source§fn current_directory(&self) -> &SystemPath
fn current_directory(&self) -> &SystemPath
Returns the current working directory
Source§fn user_config_directory(&self) -> Option<SystemPathBuf>
fn user_config_directory(&self) -> Option<SystemPathBuf>
Returns the directory path where user configurations are stored. Read more
Source§fn cache_dir(&self) -> Option<SystemPathBuf>
fn cache_dir(&self) -> Option<SystemPathBuf>
Returns the directory path where cached files are stored. Read more
Source§fn which(&self, _name: &str) -> WhichResult
fn which(&self, _name: &str) -> WhichResult
Find an executable binary’s path by name.
Source§fn read_directory<'a>(
&'a self,
path: &SystemPath,
) -> Result<Box<dyn Iterator<Item = Result<DirectoryEntry>> + 'a>>
fn read_directory<'a>( &'a self, path: &SystemPath, ) -> Result<Box<dyn Iterator<Item = Result<DirectoryEntry>> + 'a>>
Iterate over the contents of the directory at
path. Read moreSource§fn walk_directory(&self, path: &SystemPath) -> WalkDirectoryBuilder
fn walk_directory(&self, path: &SystemPath) -> WalkDirectoryBuilder
Recursively walks the content of
path. Read moreSource§fn as_writable(&self) -> Option<&dyn WritableSystem>
fn as_writable(&self) -> Option<&dyn WritableSystem>
Returns a handle to a
WritableSystem if this system is writable.fn as_any(&self) -> &dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
fn dyn_clone(&self) -> Box<dyn System>
Source§fn source_type(&self, path: &SystemPath) -> Option<PySourceType>
fn source_type(&self, path: &SystemPath) -> Option<PySourceType>
Source§fn virtual_path_source_type(
&self,
path: &SystemVirtualPath,
) -> Option<PySourceType>
fn virtual_path_source_type( &self, path: &SystemVirtualPath, ) -> Option<PySourceType>
Source§fn run_command(&self, command: Command) -> Result<Output>
fn run_command(&self, command: Command) -> Result<Output>
Runs
command and captures its standard output and standard error.Source§fn command_executor(&self) -> Option<&dyn CommandExecutor>
fn command_executor(&self) -> Option<&dyn CommandExecutor>
Returns the system’s command executor, if it supports running commands.
Source§fn path_exists(&self, path: &SystemPath) -> bool
fn path_exists(&self, path: &SystemPath) -> bool
Returns
true if path exists.Source§fn is_directory(&self, path: &SystemPath) -> bool
fn is_directory(&self, path: &SystemPath) -> bool
Returns
true if path exists and is a directory.Source§fn is_file(&self, path: &SystemPath) -> bool
fn is_file(&self, path: &SystemPath) -> bool
Returns
true if path exists and is a file.Source§impl WritableSystem for InMemorySystem
impl WritableSystem for InMemorySystem
Source§fn create_new_file(&self, path: &SystemPath) -> Result<()>
fn create_new_file(&self, path: &SystemPath) -> Result<()>
Creates a file at the given path. Read more
Source§fn write_file_bytes(&self, path: &SystemPath, content: &[u8]) -> Result<()>
fn write_file_bytes(&self, path: &SystemPath, content: &[u8]) -> Result<()>
Writes the given content to the file at the given path.
Source§fn create_directory_all(&self, path: &SystemPath) -> Result<()>
fn create_directory_all(&self, path: &SystemPath) -> Result<()>
Creates a directory at
path as well as any intermediate directories.fn dyn_clone(&self) -> Box<dyn WritableSystem>
Source§fn write_file(&self, path: &SystemPath, content: &str) -> Result<()>
fn write_file(&self, path: &SystemPath, content: &str) -> Result<()>
Writes the given content to the file at the given path.
Source§fn get_or_cache(
&self,
path: &SystemPath,
read_contents: &dyn Fn() -> Result<String>,
) -> Result<Option<SystemPathBuf>>
fn get_or_cache( &self, path: &SystemPath, read_contents: &dyn Fn() -> Result<String>, ) -> Result<Option<SystemPathBuf>>
Reads the provided file from the system cache, or creates the file if necessary. Read more
Auto Trait Implementations§
impl Freeze for InMemorySystem
impl RefUnwindSafe for InMemorySystem
impl Send for InMemorySystem
impl Sync for InMemorySystem
impl Unpin for InMemorySystem
impl UnsafeUnpin for InMemorySystem
impl UnwindSafe for InMemorySystem
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more