pub struct ServerProcess { /* private fields */ }
Expand description
Represents a running MCP server process.
Manages the lifecycle of a single MCP server, including starting, stopping,
and providing access to its standard I/O streams.
All public methods are instrumented with tracing
spans.
Implementations§
Source§impl ServerProcess
impl ServerProcess
Sourcepub fn new(name: String, config: ServerConfig) -> Self
pub fn new(name: String, config: ServerConfig) -> Self
Create a new server process instance.
This method is instrumented with tracing
.
Sourcepub fn status(&self) -> ServerStatus
pub fn status(&self) -> ServerStatus
Get the current status of the server.
This method is instrumented with tracing
.
Sourcepub async fn start(&mut self) -> Result<()>
pub async fn start(&mut self) -> Result<()>
Start the server process.
This method is instrumented with tracing
.
Sourcepub async fn stop(&mut self) -> Result<()>
pub async fn stop(&mut self) -> Result<()>
Stop the server process.
This method is instrumented with tracing
.
Sourcepub fn take_stdin(&mut self) -> Result<ChildStdin>
pub fn take_stdin(&mut self) -> Result<ChildStdin>
Take ownership of the server’s stdin handle.
This method is instrumented with tracing
.
Sourcepub fn take_stdout(&mut self) -> Result<ChildStdout>
pub fn take_stdout(&mut self) -> Result<ChildStdout>
Take ownership of the server’s stdout handle.
This method is instrumented with tracing
.
Sourcepub fn take_stderr(&mut self) -> Result<ChildStderr>
pub fn take_stderr(&mut self) -> Result<ChildStderr>
Take the stderr pipe from the process
Auto Trait Implementations§
impl Freeze for ServerProcess
impl RefUnwindSafe for ServerProcess
impl Send for ServerProcess
impl Sync for ServerProcess
impl Unpin for ServerProcess
impl UnwindSafe for ServerProcess
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