pub struct NoopShellBackend;Expand description
A no-op shell backend for testing only. All methods return
ShellError::NotPermitted,
allowing test scenarios that require an Arc<dyn ShellBackend> (without actually
running
a shell tool) to skip setup.
For real use, use defect_tools::shell::LocalShellBackend or
defect_acp::shell::AcpShellBackend.
Trait Implementations§
Source§impl ShellBackend for NoopShellBackend
impl ShellBackend for NoopShellBackend
Source§fn create(
&self,
_command: String,
_cwd: PathBuf,
) -> BoxFuture<'_, Result<TerminalId, ShellError>>
fn create( &self, _command: String, _cwd: PathBuf, ) -> BoxFuture<'_, Result<TerminalId, ShellError>>
Creates a terminal and starts the command. Read more
Source§fn output(
&self,
id: &TerminalId,
) -> BoxFuture<'_, Result<ShellOutput, ShellError>>
fn output( &self, id: &TerminalId, ) -> BoxFuture<'_, Result<ShellOutput, ShellError>>
Take a snapshot of the terminal’s current accumulated output. Read more
Source§fn wait_for_exit(
&self,
id: &TerminalId,
) -> BoxFuture<'_, Result<TerminalExitStatus, ShellError>>
fn wait_for_exit( &self, id: &TerminalId, ) -> BoxFuture<'_, Result<TerminalExitStatus, ShellError>>
Blocks until the terminal process exits.
Source§fn release(&self, _id: &TerminalId) -> BoxFuture<'_, Result<(), ShellError>>
fn release(&self, _id: &TerminalId) -> BoxFuture<'_, Result<(), ShellError>>
Release terminal resources (close file descriptors / remove internal bookkeeping). Read more
Source§fn kill(&self, id: &TerminalId) -> BoxFuture<'_, Result<(), ShellError>>
fn kill(&self, id: &TerminalId) -> BoxFuture<'_, Result<(), ShellError>>
Forcefully kill the terminal process. Does not release resources — subsequent
calls to
ShellBackend::output / ShellBackend::wait_for_exit are still
valid; releasing is handled by ShellBackend::release.Auto Trait Implementations§
impl Freeze for NoopShellBackend
impl RefUnwindSafe for NoopShellBackend
impl Send for NoopShellBackend
impl Sync for NoopShellBackend
impl Unpin for NoopShellBackend
impl UnsafeUnpin for NoopShellBackend
impl UnwindSafe for NoopShellBackend
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