pub struct SquirrelFn<'a, T: IntoSquirrelArgs> { /* private fields */ }Expand description
provides invariance for calling squirrel functions with little overhead
Implementations§
Source§impl<'a, T: IntoSquirrelArgs> SquirrelFn<'a, T>
impl<'a, T: IntoSquirrelArgs> SquirrelFn<'a, T>
Sourcepub const unsafe fn new_unchecked(obj: SQHandle<'a, SQClosure>) -> Self
pub const unsafe fn new_unchecked(obj: SQHandle<'a, SQClosure>) -> Self
creates a new SquirrelFn using the invariance of SQHandle<SQClosure>
§Safety
doesn’t check if the function passed has the correct args and return type
Sourcepub fn run(
&mut self,
sqvm: NonNull<HSquirrelVM>,
sqfunctions: &'static SquirrelFunctions,
args: T,
) -> Result<(), CallError>
pub fn run( &mut self, sqvm: NonNull<HSquirrelVM>, sqfunctions: &'static SquirrelFunctions, args: T, ) -> Result<(), CallError>
calls the underlying squirrel function on the provided sqvm
§Errors
This function will return an error if the fails to execute for some reason which is unlikely since it would be type checked
Sourcepub fn call(
&mut self,
sqvm: NonNull<HSquirrelVM>,
sqfunctions: &'static SquirrelFunctions,
args: T,
) -> Result<(), CallError>
pub fn call( &mut self, sqvm: NonNull<HSquirrelVM>, sqfunctions: &'static SquirrelFunctions, args: T, ) -> Result<(), CallError>
calls the underlying squirrel function on the provided sqvm
§Errors
This function will return an error if the fails to execute for some reason which is unlikely since it would be type checked
Trait Implementations§
Source§impl<'a, T: IntoSquirrelArgs> AsRef<SQHandle<'a, SQClosure>> for SquirrelFn<'a, T>
impl<'a, T: IntoSquirrelArgs> AsRef<SQHandle<'a, SQClosure>> for SquirrelFn<'a, T>
Source§impl<T: IntoSquirrelArgs> GetFromSQObject for SquirrelFn<'_, T>
impl<T: IntoSquirrelArgs> GetFromSQObject for SquirrelFn<'_, T>
Source§fn get_from_sqobject(obj: &SQObject) -> Self
fn get_from_sqobject(obj: &SQObject) -> Self
gets the value out of a sqobject Read more
Source§impl<T: IntoSquirrelArgs> GetFromSquirrelVm for SquirrelFn<'_, T>
impl<T: IntoSquirrelArgs> GetFromSquirrelVm for SquirrelFn<'_, T>
Source§fn get_from_sqvm(
sqvm: NonNull<HSquirrelVM>,
sqfunctions: &'static SquirrelFunctions,
stack_pos: i32,
) -> Self
fn get_from_sqvm( sqvm: NonNull<HSquirrelVM>, sqfunctions: &'static SquirrelFunctions, stack_pos: i32, ) -> Self
tries to get the value out of the squirrel stack but it cannot fail
so this can panic Read more
Source§impl<T: SQVMName + IntoSquirrelArgs> SQVMName for SquirrelFn<'_, T>
impl<T: SQVMName + IntoSquirrelArgs> SQVMName for SquirrelFn<'_, T>
Source§fn get_sqvm_name() -> String
fn get_sqvm_name() -> String
the name on the sqvm of a type Read more
Auto Trait Implementations§
impl<'a, T> Freeze for SquirrelFn<'a, T>
impl<'a, T> RefUnwindSafe for SquirrelFn<'a, T>where
T: RefUnwindSafe,
impl<'a, T> !Send for SquirrelFn<'a, T>
impl<'a, T> !Sync for SquirrelFn<'a, T>
impl<'a, T> Unpin for SquirrelFn<'a, T>
impl<'a, T> UnwindSafe for SquirrelFn<'a, T>where
T: RefUnwindSafe,
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