Struct WrappedBuilder

Source
pub struct WrappedBuilder<'ctx, U>(/* private fields */);
Expand description

Wrapper around a UserDataFields and UserDataMethods to allow [TypedUserData] implementations to be used for UserData implementations

Implementations§

Source§

impl<'ctx, U> WrappedBuilder<'ctx, U>

Source

pub fn new(u: &'ctx mut U) -> Self

Trait Implementations§

Source§

impl<'lua, 'ctx, T: UserData, U: UserDataFields<'lua, T>> TypedDataFields<'lua, T> for WrappedBuilder<'ctx, U>

Source§

fn document(&mut self, _doc: &str) -> &mut Self

Adds documentation to the next field that gets added
Source§

fn add_field<V>(&mut self, name: impl AsRef<str>, value: V)
where V: IntoLua<'lua> + Clone + 'static + Typed,

Typed version of add_field
Source§

fn add_field_function_set<S, A, F>(&mut self, name: &S, function: F)
where S: AsRef<str> + ?Sized, A: FromLua<'lua> + Typed, F: 'static + MaybeSend + FnMut(&'lua Lua, AnyUserData<'lua>, A) -> Result<()>,

Typed version of add_field_function_set
Source§

fn add_field_function_get<S, R, F>(&mut self, name: &S, function: F)
where S: AsRef<str> + ?Sized, R: IntoLua<'lua> + Typed, F: 'static + MaybeSend + Fn(&'lua Lua, AnyUserData<'lua>) -> Result<R>,

Typed version of add_field_function_get
Source§

fn add_field_function_get_set<S, R, A, GET, SET>( &mut self, name: &S, get: GET, set: SET, )
where S: AsRef<str> + ?Sized, R: IntoLua<'lua> + Typed, A: FromLua<'lua> + Typed, GET: 'static + MaybeSend + Fn(&'lua Lua, AnyUserData<'lua>) -> Result<R>, SET: 'static + MaybeSend + Fn(&'lua Lua, AnyUserData<'lua>, A) -> Result<()>,

Typed version of add_field_function_get and add_field_function_set combined
Source§

fn add_field_method_set<S, A, M>(&mut self, name: &S, method: M)
where S: AsRef<str> + ?Sized, A: FromLua<'lua> + Typed, M: 'static + MaybeSend + FnMut(&'lua Lua, &mut T, A) -> Result<()>,

Typed version of dd_field_method_set
Source§

fn add_field_method_get<S, R, M>(&mut self, name: &S, method: M)
where S: AsRef<str> + ?Sized, R: IntoLua<'lua> + Typed, M: 'static + MaybeSend + Fn(&'lua Lua, &T) -> Result<R>,

Typed version of add_field_method_get
Source§

fn add_field_method_get_set<S, R, A, GET, SET>( &mut self, name: &S, get: GET, set: SET, )
where S: AsRef<str> + ?Sized, R: IntoLua<'lua> + Typed, A: FromLua<'lua> + Typed, GET: 'static + MaybeSend + Fn(&'lua Lua, &T) -> Result<R>, SET: 'static + MaybeSend + Fn(&'lua Lua, &mut T, A) -> Result<()>,

Typed version of add_field_method_get and add_field_method_set combined
Source§

fn add_meta_field<R, F>(&mut self, meta: MetaMethod, f: F)
where F: 'static + MaybeSend + Fn(&'lua Lua) -> Result<R>, R: IntoLua<'lua>,

Typed version of add_meta_field
Source§

impl<'lua, 'ctx, T: UserData, U: UserDataMethods<'lua, T>> TypedDataMethods<'lua, T> for WrappedBuilder<'ctx, U>

Source§

fn document(&mut self, _documentation: &str) -> &mut Self

Adds documentation to the next method/function that gets added
Source§

fn add_method<S, A, R, M>(&mut self, name: &S, method: M)
where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + Fn(&'lua Lua, &T, A) -> Result<R>,

Exposes a method to lua
Source§

fn add_method_with<S, A, R, M, G>(&mut self, name: &S, method: M, _generator: G)
where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + Fn(&'lua Lua, &T, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>),

Exposes a method to lua Read more
Source§

fn add_function<S, A, R, F>(&mut self, name: &S, function: F)
where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + Fn(&'lua Lua, A) -> Result<R>,

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

fn add_function_with<S, A, R, F, G>( &mut self, name: &S, function: F, _generator: G, )
where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + Fn(&'lua Lua, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>),

Exposes a function to lua (its a method that does not take Self) Read more
Source§

fn add_method_mut<S, A, R, M>(&mut self, name: &S, method: M)
where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + FnMut(&'lua Lua, &mut T, A) -> Result<R>,

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

fn add_method_mut_with<S, A, R, M, G>( &mut self, name: &S, method: M, _generator: G, )
where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + FnMut(&'lua Lua, &mut T, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>),

Exposes a method to lua that has a mutable reference to Self Read more
Source§

fn add_meta_method<A, R, M>(&mut self, meta: MetaMethod, method: M)
where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + Fn(&'lua Lua, &T, A) -> Result<R>,

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

fn add_meta_method_with<A, R, M, G>( &mut self, meta: MetaMethod, method: M, _generator: G, )
where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + Fn(&'lua Lua, &T, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>),

Source§

fn add_async_method<'s, S: ?Sized + AsRef<str>, A, R, M, MR>( &mut self, name: &S, method: M, )
where T: 'static, M: Fn(&'lua Lua, &'s T, A) -> MR + MaybeSend + 'static, A: FromLuaMulti<'lua> + TypedMultiValue, MR: Future<Output = Result<R>> + 's, R: IntoLuaMulti<'lua>, 'lua: 's,

exposes an async method to lua
Source§

fn add_async_method_with<'s, S: ?Sized + AsRef<str>, A, R, M, MR, G>( &mut self, name: &S, method: M, _generator: G, )
where T: 'static, M: Fn(&'lua Lua, &'s T, A) -> MR + MaybeSend + 'static, A: FromLuaMulti<'lua> + TypedMultiValue, MR: Future<Output = Result<R>> + 's, R: IntoLuaMulti<'lua> + TypedMultiValue, G: Fn(&mut FunctionBuilder<A, R>), 'lua: 's,

exposes an async method to lua Read more
Source§

fn add_async_method_mut<'s, S: ?Sized + AsRef<str>, A, R, M, MR>( &mut self, name: &S, method: M, )
where T: 'static, M: Fn(&'lua Lua, &'s mut T, A) -> MR + MaybeSend + 'static, A: FromLuaMulti<'lua> + TypedMultiValue, MR: Future<Output = Result<R>> + 's, R: IntoLuaMulti<'lua>, 'lua: 's,

exposes an async method to lua
Source§

fn add_async_method_mut_with<'s, S: ?Sized + AsRef<str>, A, R, M, MR, G>( &mut self, name: &S, method: M, _generator: G, )
where T: 'static, M: Fn(&'lua Lua, &'s mut T, A) -> MR + MaybeSend + 'static, A: FromLuaMulti<'lua> + TypedMultiValue, MR: Future<Output = Result<R>> + 's, R: IntoLuaMulti<'lua> + TypedMultiValue, G: Fn(&mut FunctionBuilder<A, R>), 'lua: 's,

exposes an async method to lua Read more
Source§

fn add_function_mut<S, A, R, F>(&mut self, name: &S, function: F)
where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + FnMut(&'lua Lua, A) -> Result<R>,

Exposes a mutable function to lua
Source§

fn add_function_mut_with<S, A, R, F, G>( &mut self, name: &S, function: F, _generator: G, )
where S: ?Sized + AsRef<str>, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + FnMut(&'lua Lua, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>),

Exposes a mutable function to lua Read more
Source§

fn add_meta_function<A, R, F>(&mut self, meta: MetaMethod, function: F)
where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + Fn(&'lua Lua, A) -> Result<R>,

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

fn add_meta_function_with<A, R, F, G>( &mut self, meta: MetaMethod, function: F, _generator: G, )
where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + Fn(&'lua Lua, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>),

Source§

fn add_async_function<S, A, R, F, FR>(&mut self, name: &S, function: F)
where S: AsRef<str> + ?Sized, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + Fn(&'lua Lua, A) -> FR, FR: 'lua + Future<Output = Result<R>>,

exposes an async function to lua
Source§

fn add_async_function_with<S, A, R, F, FR, G>( &mut self, name: &S, function: F, _generator: G, )
where S: AsRef<str> + ?Sized, A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + Fn(&'lua Lua, A) -> FR, FR: 'lua + Future<Output = Result<R>>, G: Fn(&mut FunctionBuilder<A, R>),

exposes an async function to lua Read more
Source§

fn add_meta_method_mut<A, R, M>(&mut self, meta: MetaMethod, method: M)
where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + FnMut(&'lua Lua, &mut T, A) -> Result<R>,

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

fn add_meta_method_mut_with<A, R, M, G>( &mut self, meta: MetaMethod, method: M, _generator: G, )
where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, M: 'static + MaybeSend + FnMut(&'lua Lua, &mut T, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>),

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

fn add_meta_function_mut<A, R, F>(&mut self, meta: MetaMethod, function: F)
where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + FnMut(&'lua Lua, A) -> Result<R>,

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

fn add_meta_function_mut_with<A, R, F, G>( &mut self, meta: MetaMethod, function: F, _generator: G, )
where A: FromLuaMulti<'lua> + TypedMultiValue, R: IntoLuaMulti<'lua> + TypedMultiValue, F: 'static + MaybeSend + FnMut(&'lua Lua, A) -> Result<R>, G: Fn(&mut FunctionBuilder<A, R>),

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

Auto Trait Implementations§

§

impl<'ctx, U> Freeze for WrappedBuilder<'ctx, U>

§

impl<'ctx, U> RefUnwindSafe for WrappedBuilder<'ctx, U>
where U: RefUnwindSafe,

§

impl<'ctx, U> Send for WrappedBuilder<'ctx, U>
where U: Send,

§

impl<'ctx, U> Sync for WrappedBuilder<'ctx, U>
where U: Sync,

§

impl<'ctx, U> Unpin for WrappedBuilder<'ctx, U>

§

impl<'ctx, U> !UnwindSafe for WrappedBuilder<'ctx, U>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

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

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.
Source§

impl<T> MaybeSend for T
where T: Send,