full_moon::ast

Struct LuaVersion

source
pub struct LuaVersion { /* private fields */ }
Expand description

Represents the Lua version(s) to parse as. Lua 5.1 is always included. In order to get more Lua versions, you must include their respective features.

Implementations§

source§

impl LuaVersion

source

pub fn new() -> Self

Creates a new LuaVersion with the default features: Luau, Lua 5.2, Lua 5.3, and Lua 5.4.

source

pub fn lua51() -> Self

Creates a new LuaVersion with only Lua 5.1.

source

pub fn luau() -> Self

Available on crate feature luau only.

Creates a new LuaVersion with only Luau.

source

pub fn with_luau(self) -> Self

Available on crate feature luau only.

Adds Luau as a version to parse for.

source

pub fn has_luau(self) -> bool

Returns true if Luau is enabled.

source

pub fn lua52() -> Self

Available on crate feature lua52 only.

Creates a new LuaVersion with only Lua 5.2.

source

pub fn with_lua52(self) -> Self

Available on crate feature lua52 only.

Adds Lua 5.2 as a version to parse for.

source

pub fn has_lua52(self) -> bool

Returns true if Lua 5.2 is enabled.

source

pub fn lua53() -> Self

Available on crate feature lua53 only.

Creates a new LuaVersion with only Lua 5.3.

source

pub fn with_lua53(self) -> Self

Available on crate feature lua53 only.

Adds Lua 5.3 as a version to parse for.

source

pub fn has_lua53(self) -> bool

Returns true if Lua 5.3 is enabled.

source

pub fn lua54() -> Self

Available on crate feature lua54 only.

Creates a new LuaVersion with only Lua 5.4.

source

pub fn with_lua54(self) -> Self

Available on crate feature lua54 only.

Adds Lua 5.4 as a version to parse for.

source

pub fn has_lua54(self) -> bool

Returns true if Lua 5.4 is enabled.

source

pub fn luajit() -> Self

Available on crate feature luajit only.

Creates a new LuaVersion with only LuaJIT.

source

pub fn with_luajit(self) -> Self

Available on crate feature luajit only.

Adds LuaJIT as a version to parse for.

source

pub fn has_luajit(self) -> bool

Returns true if LuaJIT is enabled.

Trait Implementations§

source§

impl BitOr for LuaVersion

source§

type Output = LuaVersion

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
source§

impl BitOrAssign for LuaVersion

source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
source§

impl Clone for LuaVersion

source§

fn clone(&self) -> LuaVersion

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 LuaVersion

source§

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

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

impl Default for LuaVersion

source§

fn default() -> Self

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

impl Hash for LuaVersion

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for LuaVersion

source§

fn eq(&self, other: &LuaVersion) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for LuaVersion

source§

impl Eq for LuaVersion

source§

impl StructuralPartialEq for LuaVersion

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

source§

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