sl4f_lib/feedback_data_provider/
types.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
5/// Enum for supported Feedback commands.
6#[derive(Debug, PartialEq)]
7pub enum FeedbackDataProviderMethod {
8    /// Wraps `fuchsia.feedback.DataProvider#GetSnapshot`
9    GetSnapshot,
10}
11
12impl std::str::FromStr for FeedbackDataProviderMethod {
13    type Err = anyhow::Error;
14
15    fn from_str(method: &str) -> Result<Self, Self::Err> {
16        match method {
17            "GetSnapshot" => Ok(FeedbackDataProviderMethod::GetSnapshot),
18            _ => {
19                return Err(format_err!("invalid Feedback DataProvider Facade method: {}", method))
20            }
21        }
22    }
23}