sl4f_lib/factory_reset/
commands.rs1use crate::factory_reset::facade::FactoryResetFacade;
6use crate::factory_reset::types::FactoryResetMethod;
7use crate::server::Facade;
8use anyhow::Error;
9use async_trait::async_trait;
10use serde_json::{to_value, Value};
11
12#[async_trait(?Send)]
13impl Facade for FactoryResetFacade {
14 async fn handle_request(&self, method: String, _args: Value) -> Result<Value, Error> {
15 match method.parse()? {
16 FactoryResetMethod::FactoryReset => {
17 let result = self.factory_reset().await?;
18 Ok(to_value(result)?)
19 }
20 }
21 }
22}