sl4f_lib/feedback_data_provider/
commands.rs

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.
4
5use crate::feedback_data_provider::facade::FeedbackDataProviderFacade;
6use crate::feedback_data_provider::types::*;
7use crate::server::Facade;
8use anyhow::Error;
9use async_trait::async_trait;
10use serde_json::Value;
11
12#[async_trait(?Send)]
13impl Facade for FeedbackDataProviderFacade {
14    async fn handle_request(&self, method: String, _args: Value) -> Result<Value, Error> {
15        match method.parse()? {
16            FeedbackDataProviderMethod::GetSnapshot => self.get_snapshot().await,
17        }
18    }
19}