pub struct CopilotProcess { /* private fields */ }Expand description
A running Copilot CLI process.
Implementations§
Source§impl CopilotProcess
impl CopilotProcess
Sourcepub fn spawn(
executable: impl AsRef<Path>,
args: &[&str],
options: ProcessOptions,
) -> Result<Self>
pub fn spawn( executable: impl AsRef<Path>, args: &[&str], options: ProcessOptions, ) -> Result<Self>
Spawn a new Copilot CLI process.
Sourcepub fn spawn_stdio(cli_path: impl AsRef<Path>) -> Result<Self>
pub fn spawn_stdio(cli_path: impl AsRef<Path>) -> Result<Self>
Spawn the Copilot CLI with default options for stdio mode.
Sourcepub fn take_transport(&mut self) -> Option<StdioTransport>
pub fn take_transport(&mut self) -> Option<StdioTransport>
Take the transport (can only be called once).
Returns the stdio transport for communication with the CLI.
Sourcepub fn take_stdout(&mut self) -> Option<ChildStdout>
pub fn take_stdout(&mut self) -> Option<ChildStdout>
Take stdout (can only be called once).
Sourcepub async fn is_running(&mut self) -> bool
pub async fn is_running(&mut self) -> bool
Check if the process is still running.
Sourcepub async fn try_wait(&mut self) -> Result<Option<i32>>
pub async fn try_wait(&mut self) -> Result<Option<i32>>
Try to get the exit status without blocking.
Sourcepub fn terminate(&mut self) -> Result<()>
pub fn terminate(&mut self) -> Result<()>
Request termination of the process.
On Unix, this sends SIGTERM. On Windows, this kills the process.
Sourcepub fn take_stderr(&mut self) -> Option<ChildStderr>
pub fn take_stderr(&mut self) -> Option<ChildStderr>
Take stderr (can only be called once).
Auto Trait Implementations§
impl Freeze for CopilotProcess
impl !RefUnwindSafe for CopilotProcess
impl Send for CopilotProcess
impl Sync for CopilotProcess
impl Unpin for CopilotProcess
impl UnsafeUnpin for CopilotProcess
impl !UnwindSafe for CopilotProcess
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more