(&mut self)
| 608 | |
| 609 | impl 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)] |
no outgoing calls
no test coverage detected