Struct tealr::TypeGenerator[][src]

pub struct TypeGenerator {
    pub is_user_data: bool,
    pub type_name: Cow<'static, str>,
    pub fields: Vec<(Cow<'static, str>, Cow<'static, str>)>,
    pub methods: Vec<ExportedFunction>,
    pub mut_methods: Vec<ExportedFunction>,
    pub functions: Vec<ExportedFunction>,
    pub mut_functions: Vec<ExportedFunction>,
    pub meta_method: Vec<ExportedFunction>,
    pub meta_method_mut: Vec<ExportedFunction>,
    pub meta_function: Vec<ExportedFunction>,
    pub meta_function_mut: Vec<ExportedFunction>,
}
Expand description

This struct collects all the information needed to create the .d.tl file for your type.

Fields

is_user_data: bool

Represents if the type is UserData

type_name: Cow<'static, str>

The name of the type in teal

fields: Vec<(Cow<'static, str>, Cow<'static, str>)>

The exposed fields and their types

methods: Vec<ExportedFunction>

exported methods

mut_methods: Vec<ExportedFunction>

exported methods that mutate something

functions: Vec<ExportedFunction>

exported functions

mut_functions: Vec<ExportedFunction>

exported functions that mutate something

meta_method: Vec<ExportedFunction>

exported meta_methods

meta_method_mut: Vec<ExportedFunction>

exported meta_methods that mutate something

meta_function: Vec<ExportedFunction>

exported meta functions

meta_function_mut: Vec<ExportedFunction>

exported meta functions that mutate something

Trait Implementations

impl<'lua, T> TealDataMethods<'lua, T> for TypeGenerator where
    T: 'static + TealDataR + UserDataR
[src]

fn add_method<S: ?Sized, A, R, M>(&mut self, name: &S, _: M) where
    S: AsRef<[u8]>,
    A: FromLuaMultiR<'lua> + TealMultiValue,
    R: ToLuaMultiR<'lua> + TealMultiValue,
    M: 'static + Send + Fn(Context<'lua>, &T, A) -> ResultR<R>, 
[src]

Exposes a method to lua

fn add_method_mut<S: ?Sized, A, R, M>(&mut self, name: &S, _: M) where
    S: AsRef<[u8]>,
    A: FromLuaMultiR<'lua> + TealMultiValue,
    R: ToLuaMultiR<'lua> + TealMultiValue,
    M: 'static + Send + FnMut(Context<'lua>, &mut T, A) -> ResultR<R>, 
[src]

Exposes a method to lua that has a mutable reference to Self

fn add_function<S: ?Sized, A, R, F>(&mut self, name: &S, _: F) where
    S: AsRef<[u8]>,
    A: FromLuaMultiR<'lua> + TealMultiValue,
    R: ToLuaMultiR<'lua> + TealMultiValue,
    F: 'static + Send + Fn(Context<'lua>, A) -> ResultR<R>, 
[src]

Exposes a function to lua (its a method that does not take Self)

fn add_function_mut<S: ?Sized, A, R, F>(&mut self, name: &S, _: F) where
    S: AsRef<[u8]>,
    A: FromLuaMultiR<'lua> + TealMultiValue,
    R: ToLuaMultiR<'lua> + TealMultiValue,
    F: 'static + Send + FnMut(Context<'lua>, A) -> ResultR<R>, 
[src]

Exposes a mutable function to lua

fn add_meta_method<A, R, M>(&mut self, name: MetaMethodR, _: M) where
    A: FromLuaMultiR<'lua> + TealMultiValue,
    R: ToLuaMultiR<'lua> + TealMultiValue,
    M: 'static + Send + Fn(Context<'lua>, &T, A) -> ResultR<R>, 
[src]

Exposes a meta method to lua http://lua-users.org/wiki/MetatableEvents

fn add_meta_method_mut<A, R, M>(&mut self, name: MetaMethodR, _: M) where
    A: FromLuaMultiR<'lua> + TealMultiValue,
    R: ToLuaMultiR<'lua> + TealMultiValue,
    M: 'static + Send + FnMut(Context<'lua>, &mut T, A) -> ResultR<R>, 
[src]

Exposes a meta and mutable method to lua http://lua-users.org/wiki/MetatableEvents

fn add_meta_function<A, R, F>(&mut self, name: MetaMethodR, _: F) where
    A: FromLuaMultiR<'lua> + TealMultiValue,
    R: ToLuaMultiR<'lua> + TealMultiValue,
    F: 'static + Send + Fn(Context<'lua>, A) -> ResultR<R>, 
[src]

Exposes a meta function to lua http://lua-users.org/wiki/MetatableEvents

fn add_meta_function_mut<A, R, F>(&mut self, name: MetaMethodR, _: F) where
    A: FromLuaMultiR<'lua> + TealMultiValue,
    R: ToLuaMultiR<'lua> + TealMultiValue,
    F: 'static + Send + FnMut(Context<'lua>, A) -> ResultR<R>, 
[src]

Exposes a meta and mutable function to lua http://lua-users.org/wiki/MetatableEvents

impl<'lua, T> TealDataMethods<'lua, T> for TypeGenerator where
    T: 'static + TealDataM + UserDataM
[src]

fn add_method<S: ?Sized, A, R, M>(&mut self, name: &S, _: M) where
    S: AsRef<[u8]>,
    A: FromLuaMultiM<'lua> + TealMultiValue,
    R: ToLuaMultiM<'lua> + TealMultiValue,
    M: 'static + Send + Fn(&'lua Lua, &T, A) -> ResultM<R>, 
[src]

Exposes a method to lua

fn add_method_mut<S: ?Sized, A, R, M>(&mut self, name: &S, _: M) where
    S: AsRef<[u8]>,
    A: FromLuaMultiM<'lua> + TealMultiValue,
    R: ToLuaMultiM<'lua> + TealMultiValue,
    M: 'static + Send + FnMut(&'lua Lua, &mut T, A) -> ResultM<R>, 
[src]

Exposes a method to lua that has a mutable reference to Self

fn add_function<S: ?Sized, A, R, F>(&mut self, name: &S, _: F) where
    S: AsRef<[u8]>,
    A: FromLuaMultiM<'lua> + TealMultiValue,
    R: ToLuaMultiM<'lua> + TealMultiValue,
    F: 'static + Send + Fn(&'lua Lua, A) -> ResultM<R>, 
[src]

Exposes a function to lua (its a method that does not take Self)

fn add_function_mut<S: ?Sized, A, R, F>(&mut self, name: &S, _: F) where
    S: AsRef<[u8]>,
    A: FromLuaMultiM<'lua> + TealMultiValue,
    R: ToLuaMultiM<'lua> + TealMultiValue,
    F: 'static + Send + FnMut(&'lua Lua, A) -> ResultM<R>, 
[src]

Exposes a mutable function to lua

fn add_meta_method<A, R, M>(&mut self, name: MetaMethodM, _: M) where
    A: FromLuaMultiM<'lua> + TealMultiValue,
    R: ToLuaMultiM<'lua> + TealMultiValue,
    M: 'static + Send + Fn(&'lua Lua, &T, A) -> ResultM<R>, 
[src]

Exposes a meta method to lua http://lua-users.org/wiki/MetatableEvents

fn add_meta_method_mut<A, R, M>(&mut self, name: MetaMethodM, _: M) where
    A: FromLuaMultiM<'lua> + TealMultiValue,
    R: ToLuaMultiM<'lua> + TealMultiValue,
    M: 'static + Send + FnMut(&'lua Lua, &mut T, A) -> ResultM<R>, 
[src]

Exposes a meta and mutable method to lua http://lua-users.org/wiki/MetatableEvents

fn add_meta_function<A, R, F>(&mut self, name: MetaMethodM, _: F) where
    A: FromLuaMultiM<'lua> + TealMultiValue,
    R: ToLuaMultiM<'lua> + TealMultiValue,
    F: 'static + Send + Fn(&'lua Lua, A) -> ResultM<R>, 
[src]

Exposes a meta function to lua http://lua-users.org/wiki/MetatableEvents

fn add_meta_function_mut<A, R, F>(&mut self, name: MetaMethodM, _: F) where
    A: FromLuaMultiM<'lua> + TealMultiValue,
    R: ToLuaMultiM<'lua> + TealMultiValue,
    F: 'static + Send + FnMut(&'lua Lua, A) -> ResultM<R>, 
[src]

Exposes a meta and mutable function to lua http://lua-users.org/wiki/MetatableEvents

Auto Trait Implementations

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<T, U> Into<U> for T where
    U: From<T>, 
[src]

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

Performs the conversion.

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.