pub struct NinjaEngine { /* private fields */ }Implementations§
Source§impl NinjaEngine
impl NinjaEngine
Sourcepub async fn new() -> Result<Self, Box<dyn Error>>
pub async fn new() -> Result<Self, Box<dyn Error>>
Default constructor: modules are created with no fixed cwd. All existing call sites can keep using this.
Sourcepub async fn execute(
&self,
script: &str,
cwd: Option<&Path>,
mgr: Option<ShurikenManager>,
) -> Result<(), LuaError>
pub async fn execute( &self, script: &str, cwd: Option<&Path>, mgr: Option<ShurikenManager>, ) -> Result<(), LuaError>
Execute a raw Lua script in the global environment.
Sourcepub async fn execute_file(
&self,
path: &PathBuf,
cwd: Option<&Path>,
mgr: Option<ShurikenManager>,
) -> Result<(), LuaError>
pub async fn execute_file( &self, path: &PathBuf, cwd: Option<&Path>, mgr: Option<ShurikenManager>, ) -> Result<(), LuaError>
Execute a file in the global environment, resolving path optionally against cwd.
Sourcepub async fn execute_function(
&self,
function: &str,
path: &PathBuf,
cwd: Option<&Path>,
mgr: Option<ShurikenManager>,
) -> Result<(), LuaError>
pub async fn execute_function( &self, function: &str, path: &PathBuf, cwd: Option<&Path>, mgr: Option<ShurikenManager>, ) -> Result<(), LuaError>
Execute a specific function from a script in an isolated environment.
The script is loaded from path (optionally resolved against cwd),
its globals live in a fresh env that inherits from lua.globals(),
and then function is retrieved from that env and called.
Trait Implementations§
Source§impl Clone for NinjaEngine
impl Clone for NinjaEngine
Source§fn clone(&self) -> NinjaEngine
fn clone(&self) -> NinjaEngine
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NinjaEngine
impl !RefUnwindSafe for NinjaEngine
impl Send for NinjaEngine
impl Sync for NinjaEngine
impl Unpin for NinjaEngine
impl UnsafeUnpin for NinjaEngine
impl !UnwindSafe for NinjaEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more