mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-23 07:41:03 +00:00
14 lines
383 B
Rust
14 lines
383 B
Rust
use mlua::{MetaMethod, UserData};
|
|
|
|
#[derive(Clone, Copy)]
|
|
pub struct Layer(yazi_shared::Layer);
|
|
|
|
impl From<yazi_shared::Layer> for Layer {
|
|
fn from(event: yazi_shared::Layer) -> Self { Self(event) }
|
|
}
|
|
|
|
impl UserData for Layer {
|
|
fn add_methods<M: mlua::UserDataMethods<Self>>(methods: &mut M) {
|
|
methods.add_meta_method(MetaMethod::ToString, |_, me, ()| Ok(me.0.to_string()));
|
|
}
|
|
}
|