Skip to main content

MemoryVfsBackend

Struct MemoryVfsBackend 

Source
pub struct MemoryVfsBackend { /* private fields */ }
Expand description

Mode S: Vfs in memory (Rc<RefCell<Vfs>> matches REPL sharing).

Implementations§

Source§

impl MemoryVfsBackend

Source

pub fn new(vfs: Rc<RefCell<Vfs>>) -> Self

Trait Implementations§

Source§

impl WorkspaceBackend for MemoryVfsBackend

Source§

fn logical_cwd(&self) -> String

Source§

fn set_logical_cwd(&mut self, path: &str) -> Result<(), WorkspaceBackendError>

Source§

fn read_file(&mut self, path: &str) -> Result<Vec<u8>, WorkspaceBackendError>

Source§

fn write_file( &mut self, path: &str, data: &[u8], ) -> Result<(), WorkspaceBackendError>

Source§

fn list_dir(&mut self, path: &str) -> Result<Vec<String>, WorkspaceBackendError>

Source§

fn mkdir(&mut self, path: &str) -> Result<(), WorkspaceBackendError>

Source§

fn remove(&mut self, _path: &str) -> Result<(), WorkspaceBackendError>

Source§

fn exists(&mut self, path: &str) -> Result<bool, WorkspaceBackendError>

Source§

fn try_resolve_guest_path( &self, _logical_path: &str, ) -> Result<String, WorkspaceBackendError>

Mode P: logical path → guest absolute path. Mode S: WorkspaceBackendError::ModeSOnly.
Source§

fn run_rust_tool( &mut self, vm_session: &mut SessionHolder, program: &str, args: &[String], ) -> Result<ExitStatus, WorkspaceBackendError>

Run rustup / cargo (Mode S: sync VFS↔host/VM). Mode P skeleton: WorkspaceBackendError::Unsupported.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.