pub struct IFlowProcessManager {
pub process: Option<Child>,
/* private fields */
}Expand description
Manages iFlow CLI process lifecycle
Handles starting and stopping the iFlow CLI process, as well as providing access to its stdio streams for communication.
Fields§
§process: Option<Child>Implementations§
Source§impl IFlowProcessManager
impl IFlowProcessManager
Sourcepub fn is_port_listening(port: u16) -> bool
pub fn is_port_listening(port: u16) -> bool
Sourcepub async fn start(&mut self, use_websocket: bool) -> Result<Option<String>>
pub async fn start(&mut self, use_websocket: bool) -> Result<Option<String>>
Start the iFlow process
Starts the iFlow CLI process with ACP support and WebSocket communication.
§Returns
Ok(String)containing the WebSocket URL if the process was started successfullyErr(IFlowError)if there was an error starting the process
Sourcepub async fn stop(&mut self) -> Result<()>
pub async fn stop(&mut self) -> Result<()>
Stop the iFlow process
Attempts to gracefully stop the iFlow process if it’s running.
§Returns
Ok(())if the process was stopped successfully or wasn’t runningErr(IFlowError)if there was an error stopping the process
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Sourcepub fn take_stdin(&mut self) -> Option<ChildStdin>
pub fn take_stdin(&mut self) -> Option<ChildStdin>
Take ownership of the process’s stdin
Takes ownership of the process’s stdin stream for communication. This method can only be called once, as it consumes the stream.
§Returns
Some(ChildStdin) if the process is running and has a stdin stream, None otherwise
Sourcepub fn take_stdout(&mut self) -> Option<ChildStdout>
pub fn take_stdout(&mut self) -> Option<ChildStdout>
Take ownership of the process’s stdout
Takes ownership of the process’s stdout stream for communication. This method can only be called once, as it consumes the stream.
§Returns
Some(ChildStdout) if the process is running and has a stdout stream, None otherwise