pub struct NativeProcess { /* private fields */ }Implementations§
Source§impl NativeProcess
impl NativeProcess
pub fn new(config: ProcessConfig) -> Self
pub fn start(&self) -> Result<(), ProcessError>
pub fn write_stdin(&self, data: &[u8]) -> Result<(), ProcessError>
Sourcepub fn write_stdin_streaming(&self, data: &[u8]) -> Result<(), ProcessError>
pub fn write_stdin_streaming(&self, data: &[u8]) -> Result<(), ProcessError>
Write to the child’s stdin without closing it afterwards, so the caller can issue additional writes. Used by interactive pipe-backed sessions (#130 milestone 3) where the daemon keeps stdin open across multiple client input frames.
Sourcepub fn close_stdin(&self) -> Result<(), ProcessError>
pub fn close_stdin(&self) -> Result<(), ProcessError>
Explicitly close the child’s stdin (signals EOF to the child). Idempotent: returns Ok if stdin was already closed.
pub fn poll(&self) -> Result<Option<i32>, ProcessError>
pub fn wait(&self, timeout: Option<Duration>) -> Result<i32, ProcessError>
pub fn kill(&self) -> Result<(), ProcessError>
pub fn terminate(&self) -> Result<(), ProcessError>
Sourcepub fn terminate_group_soft(&self) -> Result<(), ProcessError>
pub fn terminate_group_soft(&self) -> Result<(), ProcessError>
Send the OS-appropriate soft termination signal to the child’s
process group (POSIX: SIGTERM to -pid; Windows: no soft path
implemented yet — returns Ok without doing anything so callers
can run the same code on both platforms and rely on the post-
grace hard kill).
Requires ProcessConfig.create_process_group=true on POSIX so
that -pid resolves to the child’s own group. With the default
create_process_group=false, the kill would walk back to the
caller’s group; the method silently no-ops in that case to avoid
signaling the wrong tree.
Used by the daemon-side pipe sessions (#130 M4 follow-up) so
that TerminationOutcome::SoftExit becomes meaningful on POSIX.
pub fn close(&self) -> Result<(), ProcessError>
pub fn pid(&self) -> Option<u32>
pub fn returncode(&self) -> Option<i32>
pub fn has_pending_stream(&self, stream: StreamKind) -> bool
pub fn has_pending_combined(&self) -> bool
pub fn drain_stream(&self, stream: StreamKind) -> Vec<Vec<u8>>
pub fn drain_combined(&self) -> Vec<StreamEvent>
pub fn read_stream( &self, stream: StreamKind, timeout: Option<Duration>, ) -> ReadStatus<Vec<u8>>
pub fn read_combined( &self, timeout: Option<Duration>, ) -> ReadStatus<StreamEvent>
pub fn captured_stdout(&self) -> Vec<Vec<u8>>
pub fn captured_stderr(&self) -> Vec<Vec<u8>>
pub fn captured_combined(&self) -> Vec<StreamEvent>
pub fn captured_stream_bytes(&self, stream: StreamKind) -> usize
pub fn captured_combined_bytes(&self) -> usize
pub fn clear_captured_stream(&self, stream: StreamKind) -> usize
pub fn clear_captured_combined(&self) -> usize
Auto Trait Implementations§
impl Freeze for NativeProcess
impl RefUnwindSafe for NativeProcess
impl Send for NativeProcess
impl Sync for NativeProcess
impl Unpin for NativeProcess
impl UnsafeUnpin for NativeProcess
impl UnwindSafe for NativeProcess
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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>
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