mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
24 lines
652 B
Rust
24 lines
652 B
Rust
use mlua::{ExternalError, FromLua, IntoLua, Lua, Value};
|
|
use serde::Deserialize;
|
|
use yazi_shared::event::ActionCow;
|
|
use yazi_widgets::Step;
|
|
|
|
#[derive(Clone, Copy, Debug, Deserialize)]
|
|
pub struct RecallForm {
|
|
#[serde(alias = "0")]
|
|
pub step: Step,
|
|
}
|
|
|
|
impl TryFrom<ActionCow> for RecallForm {
|
|
type Error = anyhow::Error;
|
|
|
|
fn try_from(a: ActionCow) -> Result<Self, Self::Error> { Ok(a.deserialize()?) }
|
|
}
|
|
|
|
impl FromLua for RecallForm {
|
|
fn from_lua(_: Value, _: &Lua) -> mlua::Result<Self> { Err("unsupported".into_lua_err()) }
|
|
}
|
|
|
|
impl IntoLua for RecallForm {
|
|
fn into_lua(self, _: &Lua) -> mlua::Result<Value> { Err("unsupported".into_lua_err()) }
|
|
}
|