Skip to main content

UserDataProxy

Struct UserDataProxy 

Source
pub struct UserDataProxy<T: StaticUserdata> { /* private fields */ }
Expand description

A newtype storing proxy userdata created via mlua::Lua::create_proxy.

the TypeName for this struct is implemented as the TypeName for T concatenated with “Class”. For example, if your type is called “MyType”, the proxy would have “MyTypeClass” for a TypeName.

the documentation for this proxy receives only static methods, i.e. those created via:

  • TealDataMethods::add_function
  • TealDataMethods::add_meta_function
  • TealDataMethods::add_meta_function_mut
  • TealDataMethods::add_function_mut
  • TealDataMethods::add_async_function
  • TealDataFields::add_field_function_get
  • TealDataFields::add_field_function_set
  • TealDataFields::add_meta_field_with

The type documentation is overriden as well.

Implementations§

Source§

impl<T: StaticUserdata> UserDataProxy<T>

Source

pub fn new(lua: &Lua) -> Result<Self, Error>

Creates a new UserDataProxy

Trait Implementations§

Source§

impl<T: StaticUserdata> IntoLua for UserDataProxy<T>

Source§

fn into_lua(self, lua: &Lua) -> Result<Value>

Performs the conversion.
Source§

impl<T: StaticUserdata + ToTypename> ToTypename for UserDataProxy<T>

Source§

fn to_typename() -> Type

generates the type representation
Source§

fn to_function_param() -> Vec<FunctionParam>

generates the type representation when used as a parameter By default will assume no name was given Read more
Source§

impl<T: StaticUserdata + TypeBody + ToTypename> TypeBody for UserDataProxy<T>

Source§

fn get_type_body() -> TypeGenerator

Fills in the TypeGenerator so a .d.tl file can be constructed.

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for UserDataProxy<T>

§

impl<T> !Send for UserDataProxy<T>

§

impl<T> !Sync for UserDataProxy<T>

§

impl<T> !UnwindSafe for UserDataProxy<T>

§

impl<T> Freeze for UserDataProxy<T>
where PhantomData<T>: Freeze,

§

impl<T> Unpin for UserDataProxy<T>
where PhantomData<T>: Unpin,

§

impl<T> UnsafeUnpin for UserDataProxy<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoLuaMulti for T
where T: IntoLua,

Source§

fn into_lua_multi(self, lua: &Lua) -> Result<MultiValue, Error>

Performs the conversion.
Source§

unsafe fn push_into_stack_multi(self, lua: &RawLua) -> Result<i32, Error>

Source§

impl<T> MaybeSend for T

Source§

impl<T> MaybeSend for T

Source§

impl<A> TealMultiValue for A
where A: ToTypename,

Source§

fn get_types_as_params() -> Vec<FunctionParam>

Gets the type representations as used for function parameters
Source§

fn get_types() -> Vec<Type>

Gets the types contained in this collection. Order IS important.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.