Enum ezlua::value::Value

source ·
pub enum Value<'a> {
    None,
    Nil,
    Bool(bool),
    Integer(lua_Integer),
    Number(lua_Number),
    LightUserdata(*mut c_void),
    String(LuaString<'a>),
    Table(Table<'a>),
    Function(Function<'a>),
    UserData(LuaUserData<'a>),
    Thread(LuaThread<'a>),
}
Expand description

Typed enumeration for lua value

Variants§

§

None

§

Nil

§

Bool(bool)

§

Integer(lua_Integer)

§

Number(lua_Number)

§

LightUserdata(*mut c_void)

§

String(LuaString<'a>)

§

Table(Table<'a>)

§

Function(Function<'a>)

§

UserData(LuaUserData<'a>)

§

Thread(LuaThread<'a>)

Implementations§

source§

impl<'a> Value<'a>

source

pub fn light_userdata<T: Sized>(p: *const T) -> Self

Trait Implementations§

source§

impl<'a> Clone for Value<'a>

source§

fn clone(&self) -> Value<'a>

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<'a> Debug for Value<'a>

source§

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

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

impl<'a> Default for Value<'a>

source§

fn default() -> Value<'a>

Returns the “default value” for a type. Read more
source§

impl<'a> FromLua<'a> for Value<'a>

source§

fn from_lua(s: &'a State, val: ValRef<'a>) -> Result<Value<'a>>

source§

const TYPE_NAME: &'static str = _

source§

impl ToLua for Value<'_>

source§

fn to_lua<'a>(self, lua: &'a State) -> Result<ValRef<'a>>

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Value<'a>

§

impl<'a> !Send for Value<'a>

§

impl<'a> !Sync for Value<'a>

§

impl<'a> Unpin for Value<'a>

§

impl<'a> !UnwindSafe for Value<'a>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
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
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

const COUNT: usize = 1usize

source§

fn from_lua_multi(s: &'a State, begin: i32) -> Result<T, Error>

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.

source§

impl<T> ToLuaMulti for Twhere T: ToLua,

source§

const VALUE_COUNT: Option<usize> =

Count of values to be pushed to lua stack
source§

fn push_multi(self, s: &State) -> Result<usize, Error>

Define how to push values onto lua stack
source§

fn value_count(&self) -> Option<usize>

Get the count of values to be pushed to lua stack, with self instance
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.
source§

impl<T> UserDataTrans<T> for T

§

type Read = &'a T

§

type Write = &'a mut T

source§

fn trans(udata: T) -> T

source§

const INIT_USERDATA: Option<fn(_: &State, _: &mut Self)> = None

source§

unsafe fn when_drop(&mut self)