async fn file_method_to_fidl(
    method_name: String,
    args: Value,
    facade: &FileFacade,
) -> Result<Value, Error> {
    match method_name.parse()? {
        FileMethod::DeleteFile => {
            let result = facade.delete_file(args).await?;
            Ok(to_value(result)?)
        }
        FileMethod::MakeDir => {
            let result = facade.make_dir(args).await?;
            Ok(to_value(result)?)
        }
        FileMethod::ReadFile => {
            let result = facade.read_file(args).await?;
            Ok(to_value(result)?)
        }
        FileMethod::WriteFile => {
            let result = facade.write_file(args).await?;
            Ok(to_value(result)?)
        }
        FileMethod::Stat => {
            let result = facade.stat(args).await?;
            Ok(to_value(result)?)
        }
    }
}
// Takes SL4F method command and executes corresponding file facade method.
Takes SL4F method command and executes corresponding file facade method.
Takes SL4F method command and executes corresponding file facade method .
async fn file_method_to_fidl(
    method_name: String,
    args: Value,
    facade: &FileFacade,
) -> Result<Value, Error> {
    match method_name.parse()? {
        FileMethod::DeleteFile => {
            let result = facade.delete_file(args).await?;
            Ok(to_value(result)?)
        }
        FileMethod::MakeDir => {
            let result = facade.make_dir(args).await?;
            Ok(to_value(result)?)
        }
        FileMethod::ReadFile => {
            let result = facade.read_file(args).await?;
            Ok(to_value(result)?)
        }
        FileMethod::WriteFile => {
            let result = facade.write_file(args).await?;
            Ok(to_value(result)?)
        }
        FileMethod::Stat => {
            let result = facade.stat(args).await?;
            Ok(to_value(result)?)
        }
    }
}
async fn file_method_to_fidl ( method_name : String , args : Value , facade : & FileFacade , ) -> Result < Value , Error > { match method_name . parse ( ) ? { FileMethod :: DeleteFile => { let result = facade . delete_file ( args ) . await ? ; Ok ( to_value ( result ) ? ) } FileMethod :: MakeDir => { let result = facade . make_dir ( args ) . await ? ; Ok ( to_value ( result ) ? ) } FileMethod :: ReadFile => { let result = facade . read_file ( args ) . await ? ; Ok ( to_value ( result ) ? ) } FileMethod :: WriteFile => { let result = facade . write_file ( args ) . await ? ; Ok ( to_value ( result ) ? ) } FileMethod :: Stat => { let result = facade . stat ( args ) . await ? ; Ok ( to_value ( result ) ? ) } } }
Takes SL4F method command and executes corresponding file facade method.
Takes SL4F method command and executes corresponding file facade method .
method_name
String
args
Value
facade
&FileFacade