MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / get_running_service

Method get_running_service

crates/chat-cli/src/mcp_client/client.rs:610–624  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

608
609impl InitializedMcpClient {
610 pub async fn get_running_service(&mut self) -> Result<&RunningService, McpClientError> {
611 match self {
612 InitializedMcpClient::Pending(handle) if handle.is_finished() => {
613 let running_service = handle.await??;
614 *self = InitializedMcpClient::Ready(running_service);
615 let InitializedMcpClient::Ready(running_service) = self else {
616 unreachable!()
617 };
618
619 Ok(running_service)
620 },
621 InitializedMcpClient::Ready(running_service) => Ok(running_service),
622 InitializedMcpClient::Pending(_) => Err(McpClientError::NotReady),
623 }
624 }
625}
626
627#[cfg(test)]

Callers 2

get_promptMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected