mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
19 lines
525 B
Rust
19 lines
525 B
Rust
use mlua::{ExternalError, FromLua, IntoLua, Lua, Value};
|
|
use yazi_shared::event::{CmdCow, Data};
|
|
|
|
#[derive(Debug)]
|
|
pub struct SeekOpt {
|
|
pub units: i16,
|
|
}
|
|
|
|
impl From<CmdCow> for SeekOpt {
|
|
fn from(c: CmdCow) -> Self { Self { units: c.first().and_then(Data::as_i16).unwrap_or(0) } }
|
|
}
|
|
|
|
impl FromLua for SeekOpt {
|
|
fn from_lua(_: Value, _: &Lua) -> mlua::Result<Self> { Err("unsupported".into_lua_err()) }
|
|
}
|
|
|
|
impl IntoLua for SeekOpt {
|
|
fn into_lua(self, _: &Lua) -> mlua::Result<Value> { Err("unsupported".into_lua_err()) }
|
|
}
|