sl4f_lib/factory_store/
types.rs1use serde::Deserialize;
6
7pub enum FactoryStoreMethod {
9 ListFiles,
10 ReadFile,
11}
12
13impl std::str::FromStr for FactoryStoreMethod {
14 type Err = anyhow::Error;
15
16 fn from_str(method: &str) -> Result<Self, Self::Err> {
17 match method {
18 "ListFiles" => Ok(FactoryStoreMethod::ListFiles),
19 "ReadFile" => Ok(FactoryStoreMethod::ReadFile),
20 _ => return Err(format_err!("invalid Factory FIDL method: {}", method)),
21 }
22 }
23}
24
25#[derive(Deserialize, Debug)]
26pub struct ListFilesRequest {
27 pub provider: FactoryStoreProvider,
28}
29
30#[derive(Deserialize, Debug)]
31pub struct ReadFileRequest {
32 pub provider: FactoryStoreProvider,
33 pub filename: String,
34}
35
36#[derive(Deserialize, Debug)]
37#[serde(rename_all = "camelCase")]
38pub enum FactoryStoreProvider {
39 Alpha,
40 Cast,
41 Misc,
42 Playready,
43 Weave,
44 Widevine,
45}