pub trait TerminalProvider:
Environment
+ Send
+ Sync {
// Required methods
fn CreateTerminal<'life0, 'async_trait>(
&'life0 self,
OptionsValue: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn SendTextToTerminal<'life0, 'async_trait>(
&'life0 self,
TerminalId: u64,
Text: String,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn DisposeTerminal<'life0, 'async_trait>(
&'life0 self,
TerminalId: u64,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn ShowTerminal<'life0, 'async_trait>(
&'life0 self,
TerminalId: u64,
PreserveFocus: bool,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn HideTerminal<'life0, 'async_trait>(
&'life0 self,
TerminalId: u64,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn GetTerminalProcessId<'life0, 'async_trait>(
&'life0 self,
TerminalId: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<u32>, CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
An abstract service contract for an environment component that can manage integrated terminal processes.
This trait is implemented by MountainEnvironment, and its methods are
responsible for spawning and managing native pseudo-terminal (PTY)
processes, handling their I/O, and managing their lifecycle.
Required Methods§
Sourcefn CreateTerminal<'life0, 'async_trait>(
&'life0 self,
OptionsValue: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn CreateTerminal<'life0, 'async_trait>(
&'life0 self,
OptionsValue: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Creates a new terminal instance with the given options.
§Parameters
OptionsValue: Aserde_json::ValueDTO representingTerminalOptions, which can specify the name, shell path, arguments, etc.
§Returns
A Result containing a JSON Value with details of the created
terminal (e.g., its ID and process ID), or a CommonError on failure.
Sourcefn SendTextToTerminal<'life0, 'async_trait>(
&'life0 self,
TerminalId: u64,
Text: String,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn SendTextToTerminal<'life0, 'async_trait>(
&'life0 self,
TerminalId: u64,
Text: String,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends a string of text as input to a specific terminal instance’s underlying pseudo-terminal process.
§Parameters
TerminalId: The unique identifier of the target terminal.Text: The text to send to the terminal’s standard input.
Sourcefn DisposeTerminal<'life0, 'async_trait>(
&'life0 self,
TerminalId: u64,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn DisposeTerminal<'life0, 'async_trait>(
&'life0 self,
TerminalId: u64,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Disposes of a specific terminal instance. This involves terminating the underlying shell process and cleaning up any associated resources.
§Parameters
TerminalId: The unique identifier of the terminal to dispose of.
Sourcefn ShowTerminal<'life0, 'async_trait>(
&'life0 self,
TerminalId: u64,
PreserveFocus: bool,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ShowTerminal<'life0, 'async_trait>(
&'life0 self,
TerminalId: u64,
PreserveFocus: bool,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Shows a terminal in the UI, optionally giving it focus.
§Parameters
TerminalId: The unique identifier of the terminal to show.PreserveFocus: Iftrue, the terminal panel is revealed but focus is not given to it.
Sourcefn HideTerminal<'life0, 'async_trait>(
&'life0 self,
TerminalId: u64,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn HideTerminal<'life0, 'async_trait>(
&'life0 self,
TerminalId: u64,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Hides the terminal panel if the specified terminal is active.
§Parameters
TerminalId: The unique identifier of the terminal to hide.