fix: expose TokioChildWrapper::id() in TokioChildProcess and TokioChildProcessOut (#254)

This commit is contained in:
bl-ue 2025-06-12 00:31:00 -06:00 • committed by GitHub
commit a55bbddcf1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -48,6 +48,13 @@ pin_project_lite::pin_project! {
} }
} }
impl TokioChildProcessOut {
/// Get the process ID of the child process.
pub fn id(&self) -> Option<u32> {
self.child.inner.id()
}
}
impl AsyncRead for TokioChildProcessOut { impl AsyncRead for TokioChildProcessOut {
fn poll_read( fn poll_read(
self: std::pin::Pin<&mut Self>, self: std::pin::Pin<&mut Self>,
@ -77,6 +84,11 @@ impl TokioChildProcess {
}) })
} }
/// Get the process ID of the child process.
pub fn id(&self) -> Option<u32> {
self.child.inner.id()
}
pub fn split(self) -> (TokioChildProcessOut, ChildStdin) { pub fn split(self) -> (TokioChildProcessOut, ChildStdin) {
let TokioChildProcess { let TokioChildProcess {
child, child,