Skip to content

Commit a55bbdd

Browse files
authored
fix: expose TokioChildWrapper::id() in TokioChildProcess and TokioChildProcessOut (#254)
1 parent db03f63 commit a55bbdd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

crates/rmcp/src/transport/child_process.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ pin_project_lite::pin_project! {
4848
}
4949
}
5050

51+
impl TokioChildProcessOut {
52+
/// Get the process ID of the child process.
53+
pub fn id(&self) -> Option<u32> {
54+
self.child.inner.id()
55+
}
56+
}
57+
5158
impl AsyncRead for TokioChildProcessOut {
5259
fn poll_read(
5360
self: std::pin::Pin<&mut Self>,
@@ -77,6 +84,11 @@ impl TokioChildProcess {
7784
})
7885
}
7986

87+
/// Get the process ID of the child process.
88+
pub fn id(&self) -> Option<u32> {
89+
self.child.inner.id()
90+
}
91+
8092
pub fn split(self) -> (TokioChildProcessOut, ChildStdin) {
8193
let TokioChildProcess {
8294
child,

0 commit comments

Comments
 (0)