1use super::{as_tbl, String};
15use crate::{wrapped_table, LuaEnv};
16use anyhow::Result;
17use mlua::{prelude::*, Value};
18use serde_derive::Serialize;
19use std::ops::Deref;
20
21wrapped_table!(Lfs, None);
22
23impl<'lua> Lfs<'lua> {
24 pub fn singleton<L: LuaEnv<'lua>>(lua: L) -> Result<Self> {
25 Ok(lua.inner().globals().raw_get("lfs")?)
26 }
27
28 pub fn writedir(&self) -> Result<String> {
29 Ok(self.t.call_function("writedir", ())?)
30 }
31
32 pub fn tempdir(&self) -> Result<String> {
33 Ok(self.t.call_function("tempdir", ())?)
34 }
35}