IFlowProcessManager

Struct IFlowProcessManager 

Source
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

Source

pub fn new(start_port: u16, debug: bool) -> Self

Create a new process manager

§Arguments
  • start_port - The port to start the process on
  • debug - Whether to enable debug mode
§Returns

A new IFlowProcessManager instance

Source

pub fn is_port_listening(port: u16) -> bool

Check if a port is listening (has a server running)

§Arguments
  • port - Port number to check
§Returns

True if the port is listening, False otherwise

Source

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 successfully
  • Err(IFlowError) if there was an error starting the process
Source

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 running
  • Err(IFlowError) if there was an error stopping the process
Source

pub fn port(&self) -> Option<u16>

Get the port the iFlow process is running on

§Returns

The port number, or None if not running

Source

pub fn is_running(&self) -> bool

Check if the iFlow process is running

§Returns

true if the process is running, false otherwise

Source

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

Source

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

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,