pub struct TypedFunction<Params, Response>where
Params: TypedMultiValue,
Response: TypedMultiValue,{ /* private fields */ }Expand description
Implementations§
Source§impl<Params, Response> TypedFunction<Params, Response>
impl<Params, Response> TypedFunction<Params, Response>
Sourcepub fn call(&self, params: Params) -> Result<Response>
pub fn call(&self, params: Params) -> Result<Response>
Same as Function::call but with the param and return types already specified
Sourcepub unsafe fn call_unsafe(&self, params: Params) -> Response
pub unsafe fn call_unsafe(&self, params: Params) -> Response
Same as Function::call but with the param and return types already specified
§Safety
Panics if any lua errors occur
Sourcepub fn from_rust<F>(&self, lua: &Lua, func: F) -> Result<Self>where
Params: TypedMultiValue + FromLuaMulti,
Response: TypedMultiValue + IntoLuaMulti,
F: Fn(&Lua, Params) -> Result<Response> + MaybeSend + 'static,
pub fn from_rust<F>(&self, lua: &Lua, func: F) -> Result<Self>where
Params: TypedMultiValue + FromLuaMulti,
Response: TypedMultiValue + IntoLuaMulti,
F: Fn(&Lua, Params) -> Result<Response> + MaybeSend + 'static,
Create a typed function from a rust function.
This will call Lua::create_function under the hood
Trait Implementations§
Source§impl<Params, Response> FromLua for TypedFunction<Params, Response>where
Params: TypedMultiValue,
Response: TypedMultiValue,
impl<Params, Response> FromLua for TypedFunction<Params, Response>where
Params: TypedMultiValue,
Response: TypedMultiValue,
Source§impl<Params, Response> IntoLua for TypedFunction<Params, Response>where
Params: TypedMultiValue,
Response: TypedMultiValue,
impl<Params, Response> IntoLua for TypedFunction<Params, Response>where
Params: TypedMultiValue,
Response: TypedMultiValue,
Source§impl<Params, Response> Typed for TypedFunction<Params, Response>where
Params: TypedMultiValue,
Response: TypedMultiValue,
impl<Params, Response> Typed for TypedFunction<Params, Response>where
Params: TypedMultiValue,
Response: TypedMultiValue,
Auto Trait Implementations§
impl<Params, Response> Freeze for TypedFunction<Params, Response>
impl<Params, Response> !RefUnwindSafe for TypedFunction<Params, Response>
impl<Params, Response> Send for TypedFunction<Params, Response>
impl<Params, Response> Sync for TypedFunction<Params, Response>
impl<Params, Response> Unpin for TypedFunction<Params, Response>
impl<Params, Response> UnsafeUnpin for TypedFunction<Params, Response>
impl<Params, Response> !UnwindSafe for TypedFunction<Params, Response>
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> FromLuaMulti for Twhere
T: FromLua,
impl<T> FromLuaMulti for Twhere
T: FromLua,
Source§fn from_lua_multi(values: MultiValue, lua: &Lua) -> Result<T, Error>
fn from_lua_multi(values: MultiValue, lua: &Lua) -> Result<T, Error>
Performs the conversion. Read more
fn from_lua_args( args: MultiValue, i: usize, to: Option<&str>, lua: &Lua, ) -> Result<T, Error>
unsafe fn from_stack_multi(nvals: i32, lua: &RawLua) -> Result<T, Error>
unsafe fn from_stack_args( nargs: i32, i: usize, to: Option<&str>, lua: &RawLua, ) -> Result<T, Error>
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 moreSource§impl<T> IntoLuaMulti for Twhere
T: IntoLua,
impl<T> IntoLuaMulti for Twhere
T: IntoLua,
Source§fn into_lua_multi(self, lua: &Lua) -> Result<MultiValue, Error>
fn into_lua_multi(self, lua: &Lua) -> Result<MultiValue, Error>
Performs the conversion.