Struct tealr::mlu::TypedFunction[][src]

pub struct TypedFunction<'lua, Params, Response> where
    Params: ToLuaMulti<'lua> + TealMultiValue,
    Response: FromLuaMulti<'lua> + TealMultiValue
{ /* fields omitted */ }
Expand description

A typed wrapper around mlua::Function

Implementations

impl<'lua, Params, Response> TypedFunction<'lua, Params, Response> where
    Params: ToLuaMulti<'lua> + TealMultiValue,
    Response: FromLuaMulti<'lua> + TealMultiValue
[src]

pub fn call(&self, params: Params) -> Result<Response>[src]

Same as mlua::Function::call. Calls the function with the given parameters.

pub fn force_call(&self, params: Params) -> Response[src]

Calls the function with the given parameters. Panics if something has gone wrong.

Trait Implementations

impl<'lua, Params, Response> Clone for TypedFunction<'lua, Params, Response> where
    Params: ToLuaMulti<'lua> + TealMultiValue,
    Response: FromLuaMulti<'lua> + TealMultiValue
[src]

fn clone(&self) -> Self[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'lua, Params: Debug, Response: Debug> Debug for TypedFunction<'lua, Params, Response> where
    Params: ToLuaMulti<'lua> + TealMultiValue,
    Response: FromLuaMulti<'lua> + TealMultiValue
[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<'lua, Params, Response> FromLua<'lua> for TypedFunction<'lua, Params, Response> where
    Params: ToLuaMulti<'lua> + TealMultiValue,
    Response: FromLuaMulti<'lua> + TealMultiValue
[src]

fn from_lua(lua_value: Value<'lua>, lua: &'lua Lua) -> Result<Self>[src]

Performs the conversion.

impl<'lua, Params, Response> ToLua<'lua> for TypedFunction<'lua, Params, Response> where
    Params: ToLuaMulti<'lua> + TealMultiValue,
    Response: FromLuaMulti<'lua> + TealMultiValue
[src]

fn to_lua(self, _: &'lua Lua) -> Result<Value<'lua>>[src]

Performs the conversion.

impl<'lua, Params, Response> TypeName for TypedFunction<'lua, Params, Response> where
    Params: ToLuaMulti<'lua> + TealMultiValue,
    Response: FromLuaMulti<'lua> + TealMultiValue
[src]

fn get_type_name(_: Direction) -> Cow<'static, str>[src]

returns the type name as how it should show up in the generated .d.tl file

fn is_external() -> bool[src]

This method tells the generator that the type will always be available This is pretty much only the case for native lua/teal types like number Read more

Auto Trait Implementations

impl<'lua, Params, Response> !RefUnwindSafe for TypedFunction<'lua, Params, Response>

impl<'lua, Params, Response> !Send for TypedFunction<'lua, Params, Response>

impl<'lua, Params, Response> !Sync for TypedFunction<'lua, Params, Response>

impl<'lua, Params, Response> Unpin for TypedFunction<'lua, Params, Response> where
    Params: Unpin,
    Response: Unpin

impl<'lua, Params, Response> !UnwindSafe for TypedFunction<'lua, Params, Response>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<'lua, T> FromLuaMulti<'lua> for T where
    T: FromLua<'lua>, 
[src]

pub fn from_lua_multi(
    values: MultiValue<'lua>,
    lua: &'lua Lua
) -> Result<T, Error>
[src]

Performs the conversion. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<'lua, T> ToLuaMulti<'lua> for T where
    T: ToLua<'lua>, 
[src]

pub fn to_lua_multi(self, lua: &'lua Lua) -> Result<MultiValue<'lua>, Error>[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.