Struct me3_framework::scripting::ScriptHost
source · [−]pub struct ScriptHost { /* private fields */ }
Implementations
sourceimpl ScriptHost
impl ScriptHost
pub fn eval<S: AsRef<str>, F: FnOnce(Result<MultiValue<'_>, Error>) -> Result<T, FrameworkError>, T>(
&self,
code: S,
result_handler: F
) -> Result<T, FrameworkError>
pub fn load_script<P>(&self, path: P) -> Result<(), FrameworkError>where
P: AsRef<Path>,
pub fn set_table<S, F>(
&self,
name: S,
constructor: F
) -> Result<(), FrameworkError>where
S: AsRef<str>,
F: FnOnce(Table<'_>) -> Result<Table<'_>, Error>,
pub fn set<S, T>(&self, name: S, value: T)where
S: AsRef<str>,
T: ScriptType + 'static,
Trait Implementations
sourceimpl FrameworkGlobal for ScriptHost
impl FrameworkGlobal for ScriptHost
fn cell() -> &'static OnceCell<Self>
fn create() -> Result<Self, FrameworkError>
fn get_or_create() -> Result<&'static Self, FrameworkError>
sourceunsafe fn get_unchecked() -> &'static Self
unsafe fn get_unchecked() -> &'static Self
Safety Read more
Auto Trait Implementations
impl RefUnwindSafe for ScriptHost
impl Send for ScriptHost
impl Sync for ScriptHost
impl Unpin for ScriptHost
impl UnwindSafe for ScriptHost
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more