Remove context by name
(&mut self, name: &str)
| 480 | |
| 481 | /// Remove context by name |
| 482 | pub async fn remove_by_name(&mut self, name: &str) -> Result<(), String> { |
| 483 | if let Some(context) = self.agent_client.get_context_by_name(name).await { |
| 484 | self.agent_client |
| 485 | .remove_context_by_id(&context.id) |
| 486 | .await |
| 487 | .map_err(|e| e.to_string()) |
| 488 | } else { |
| 489 | Err(format!("No context found with name '{}'", name)) |
| 490 | } |
| 491 | } |
| 492 | |
| 493 | /// Remove context by ID |
| 494 | pub async fn remove_by_id(&mut self, context_id: &str) -> Result<(), String> { |
no test coverage detected