pub enum LuaMat2 {
    Owned(UnsafeCell<Mat2>, Arc<RwLock<RawRwLock, ()>>),
    Ref(ScriptRef),
}
Expand description

A script wrapper for the type Mat2

Variants§

Implementations§

source§

impl LuaMat2

source

pub fn script_ref(&self, world_ptr: WorldPointer) -> ScriptRef

Creates a script reference pointing to the wrapped value.

Depending on this value it may be a lua owned or reflect relative reference

source

pub fn new(b: Mat2) -> LuaMat2

source

pub fn new_ref(b: ScriptRef) -> LuaMat2

source

pub fn val<G, F>(&self, accessor: F) -> Result<G, ReflectionError>where F: FnOnce(&Mat2) -> G,

Perform an operation on the base type and optionally retrieve something by value may require a read lock on the world in case this is a reference

source

pub fn val_mut<G, F>(&mut self, accessor: F) -> Result<G, ReflectionError>where F: FnOnce(&mut Mat2) -> G,

source

pub fn apply_self_to_base( &self, other: &mut ScriptRef ) -> Result<(), ReflectionError>

Applies Self to another ScriptRef. may require a write lock on the world

source

pub fn inner(&self) -> Result<Mat2, ReflectionError>where Mat2: Clone,

retrieves the underlying value by cloning it

Trait Implementations§

source§

impl Clone for LuaMat2

source§

fn clone(&self) -> LuaMat2

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LuaMat2

source§

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

Formats the value using the given formatter. Read more
source§

impl Drop for LuaMat2

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl TealData for LuaMat2

source§

fn add_methods<'lua, T>(methods: &mut T)where T: TealDataMethods<'lua, LuaMat2>,

same as UserData::add_methods. Refer to its documentation on how to use it. Read more
source§

fn add_fields<'lua, T>(fields: &mut T)where T: TealDataFields<'lua, LuaMat2>,

same as UserData::add_fields. Refer to its documentation on how to use it. Read more
source§

impl TypeBody for LuaMat2

source§

fn get_type_body() -> TypeGenerator

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

impl TypeName for LuaMat2

source§

fn get_type_parts() -> Cow<'static, [NamePart]>

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

fn get_type_parts_as_global() -> Cow<'static, [NamePart]>

Generates the typename when used to describe a global value. Read more
§

fn get_type_kind() -> KindOfType

This method tells the generator if this type is builtin to teal/lua, if it comes from somewhere else or if it stands in as a generic Read more
§

fn collect_children(_: &mut Vec<TealType, Global>)

Creates/updates a list of every child type this type has This is used to properly label methods/functions as being generic.
source§

impl UserData for LuaMat2

source§

fn add_fields<'lua, F>(fields: &mut F)where F: UserDataFields<'lua, LuaMat2>,

Adds custom fields specific to this userdata.
source§

fn add_methods<'lua, M>(methods: &mut M)where M: UserDataMethods<'lua, LuaMat2>,

Adds custom methods and operators specific to this userdata.
source§

impl Sync for LuaMat2

Safety: we make this sync via RwLock<()> assuming invariants are upheld

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T, U> AsBindGroupShaderType<U> for Twhere U: ShaderType, &'a T: for<'a> Into<U>,

§

fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U

Return the T [ShaderType] for self. When used in [AsBindGroup] derives, it is safe to assume that all images in self exist.
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for Twhere T: Any,

§

fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for Twhere T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send + 'static>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<'lua, T> FromLua<'lua> for Twhere T: 'static + UserData + Clone,

source§

fn from_lua(value: Value<'lua>, _: &'lua Lua) -> Result<T, Error>

Performs the conversion.
source§

impl<'lua, T> FromLuaMulti<'lua> for Twhere T: FromLua<'lua>,

source§

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

Performs the conversion. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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.

§

impl<A> TealMultiValue for Awhere A: TypeName,

§

fn get_types() -> Vec<NamePart, Global>

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

impl<'lua, T> ToLua<'lua> for Twhere T: 'static + MaybeSend + UserData,

source§

fn to_lua(self, lua: &'lua Lua) -> Result<Value<'lua>, Error>

Performs the conversion.
source§

impl<'lua, T> ToLuaMulti<'lua> for Twhere T: ToLua<'lua>,

source§

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

Performs the conversion.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

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

§

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 Twhere U: TryFrom<T>,

§

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

impl<T> TypeData for Twhere T: 'static + Send + Sync + Clone,

§

fn clone_type_data(&self) -> Box<dyn TypeData + 'static, Global>

§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<T> Event for Twhere T: Send + Sync + 'static,

source§

impl<T> LuaArg for Twhere T: for<'lua> ToLuaMulti<'lua> + Clone + Sync + Send + 'static,

§

impl<T> MaybeSend for Twhere T: Send,

§

impl<E> PriorityEvent for Ewhere E: Send + Sync + 'static,

§

impl<T> StaticUserdata for Twhere T: UserData + 'static,