pub trait LuaExtras {
Show 17 methods
// Required methods
fn path(&self) -> Result<String>;
fn cpath(&self) -> Result<String>;
fn prepend_path<S: AsRef<Path>>(&self, path: S) -> Result<()>;
fn prepend_paths<S: AsRef<Path>>(
&self,
paths: impl IntoIterator<Item = S>,
) -> Result<()>;
fn append_path<S: AsRef<Path>>(&self, path: S) -> Result<()>;
fn append_paths<S: AsRef<Path>>(
&self,
paths: impl IntoIterator<Item = S>,
) -> Result<()>;
fn set_path<S: AsRef<Path>>(&self, path: S) -> Result<()>;
fn set_paths<S: AsRef<Path>>(
&self,
paths: impl IntoIterator<Item = S>,
) -> Result<()>;
fn prepend_cpath<S: AsRef<Path>>(&self, path: S) -> Result<()>;
fn prepend_cpaths<S: AsRef<Path>>(
&self,
paths: impl IntoIterator<Item = S>,
) -> Result<()>;
fn append_cpath<S: AsRef<Path>>(&self, path: S) -> Result<()>;
fn append_cpaths<S: AsRef<Path>>(
&self,
paths: impl IntoIterator<Item = S>,
) -> Result<()>;
fn set_cpath<S: AsRef<Path>>(&self, path: S) -> Result<()>;
fn set_cpaths<S: AsRef<Path>>(
&self,
paths: impl IntoIterator<Item = S>,
) -> Result<()>;
fn set_global<'lua, K, V>(&'lua self, key: K, value: V) -> Result<()>
where K: IntoLua<'lua>,
V: IntoLua<'lua>;
fn set_global_function<'lua, K, A, R, F>(
&'lua self,
key: K,
value: F,
) -> Result<()>
where K: IntoLua<'lua>,
A: FromLuaMulti<'lua>,
R: IntoLuaMulti<'lua>,
F: Fn(&'lua Lua, A) -> Result<R> + Send + 'static;
fn require<'lua, R: FromLua<'lua>>(
&'lua self,
path: impl AsRef<str>,
) -> Result<R>;
}
Expand description
Required Methods§
Sourcefn path(&self) -> Result<String>
fn path(&self) -> Result<String>
Get the package.path
value
This is the value used by the lua engine to resolve require
calls on lua
files.
see:
Sourcefn cpath(&self) -> Result<String>
fn cpath(&self) -> Result<String>
Get the package.cpath
value
This is the value used by the lua engine to resolve require
calls on lib
files.
see:
Sourcefn prepend_path<S: AsRef<Path>>(&self, path: S) -> Result<()>
fn prepend_path<S: AsRef<Path>>(&self, path: S) -> Result<()>
Prepend a path tothe package.path
value
This is the value used by the lua engine to resolve require
calls.
see:
Sourcefn prepend_paths<S: AsRef<Path>>(
&self,
paths: impl IntoIterator<Item = S>,
) -> Result<()>
fn prepend_paths<S: AsRef<Path>>( &self, paths: impl IntoIterator<Item = S>, ) -> Result<()>
Prepend paths to the package.path
value
This is the value used by the lua engine to resolve require
calls.
see:
Sourcefn append_path<S: AsRef<Path>>(&self, path: S) -> Result<()>
fn append_path<S: AsRef<Path>>(&self, path: S) -> Result<()>
Append a path tothe package.path
value
This is the value used by the lua engine to resolve require
calls.
see:
Sourcefn append_paths<S: AsRef<Path>>(
&self,
paths: impl IntoIterator<Item = S>,
) -> Result<()>
fn append_paths<S: AsRef<Path>>( &self, paths: impl IntoIterator<Item = S>, ) -> Result<()>
Append paths to the package.path
value
This is the value used by the lua engine to resolve require
calls.
see:
Sourcefn set_path<S: AsRef<Path>>(&self, path: S) -> Result<()>
fn set_path<S: AsRef<Path>>(&self, path: S) -> Result<()>
Set the package.path
value
This is the value used by the lua engine to resolve require
calls.
see:
Sourcefn set_paths<S: AsRef<Path>>(
&self,
paths: impl IntoIterator<Item = S>,
) -> Result<()>
fn set_paths<S: AsRef<Path>>( &self, paths: impl IntoIterator<Item = S>, ) -> Result<()>
Set the package.path
values
This is the value used by the lua engine to resolve require
calls.
see:
Sourcefn prepend_cpath<S: AsRef<Path>>(&self, path: S) -> Result<()>
fn prepend_cpath<S: AsRef<Path>>(&self, path: S) -> Result<()>
Prepend a path tothe package.cpath
value
This is the value used by the lua engine to resolve require
calls.
see:
Sourcefn prepend_cpaths<S: AsRef<Path>>(
&self,
paths: impl IntoIterator<Item = S>,
) -> Result<()>
fn prepend_cpaths<S: AsRef<Path>>( &self, paths: impl IntoIterator<Item = S>, ) -> Result<()>
Prepend paths to the package.cpath
value
This is the value used by the lua engine to resolve require
calls.
see:
Sourcefn append_cpath<S: AsRef<Path>>(&self, path: S) -> Result<()>
fn append_cpath<S: AsRef<Path>>(&self, path: S) -> Result<()>
Append a path to the package.cpath
value
This is the value used by the lua engine to resolve require
calls.
see:
Sourcefn append_cpaths<S: AsRef<Path>>(
&self,
paths: impl IntoIterator<Item = S>,
) -> Result<()>
fn append_cpaths<S: AsRef<Path>>( &self, paths: impl IntoIterator<Item = S>, ) -> Result<()>
Append paths to the package.cpath
value
This is the value used by the lua engine to resolve require
calls.
see:
Sourcefn set_cpath<S: AsRef<Path>>(&self, path: S) -> Result<()>
fn set_cpath<S: AsRef<Path>>(&self, path: S) -> Result<()>
Set the package.cpath
value
This is the value used by the lua engine to resolve require
calls.
see:
Sourcefn set_cpaths<S: AsRef<Path>>(
&self,
paths: impl IntoIterator<Item = S>,
) -> Result<()>
fn set_cpaths<S: AsRef<Path>>( &self, paths: impl IntoIterator<Item = S>, ) -> Result<()>
Set the package.cpath
values
This is the value used by the lua engine to resolve require
calls.
see:
Sourcefn set_global<'lua, K, V>(&'lua self, key: K, value: V) -> Result<()>
fn set_global<'lua, K, V>(&'lua self, key: K, value: V) -> Result<()>
Set a global variable
fn set_global_function<'lua, K, A, R, F>(
&'lua self,
key: K,
value: F,
) -> Result<()>where
K: IntoLua<'lua>,
A: FromLuaMulti<'lua>,
R: IntoLuaMulti<'lua>,
F: Fn(&'lua Lua, A) -> Result<R> + Send + 'static,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.