1// Copyright 2020 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
45use crate::diagnostics::facade::DiagnosticsFacade;
6use crate::diagnostics::types::*;
7use crate::server::Facade;
8use anyhow::Error;
9use async_trait::async_trait;
10use serde_json::Value;
1112#[async_trait(?Send)]
13impl Facade for DiagnosticsFacade {
14async fn handle_request(&self, method: String, args: Value) -> Result<Value, Error> {
15match method.parse()? {
16 DiagnosticsMethod::SnapshotInspect => {
17let parsed_args: SnapshotInspectArgs = serde_json::from_value(args)?;
18self.snapshot_inspect(parsed_args).await
19}
20 }
21 }
22}