Enum kailua_types::ty::Tables
[−]
[src]
pub enum Tables { Fields(RVar), Array(Slot), ArrayN(Slot), Map(Ty, Slot), All, }
Table types.
Variants
Fields(RVar)
A tuple or record type, represented by a row variable.
An empty inextensible table is represented as Tables::Fields(RVar::empty())
.
Array(Slot)
An array type vector<T>
, where T
is implicitly nilable.
This type should be explicit (as it's indistinguishable from map<integer, T>
).
ArrayN(Slot)
Almost same to Tables::Array
but also allows for indexing n
(always results in integer
).
This is used for an implicit arg
variable for variadic arguments in Lua 5.0.
Kailua supports this in Lua 5.1 for the backward compatibility.
Map(Ty, Slot)
A map type map<T, U>
, where T
is implicitly non-nilable and U
is implicitly nilable.
This type should be explicit (as map<integer, U>
is indistinguishable from vector<U>
).
All
Any table type.
Methods
impl Tables
[src]
fn generalize(self, ctx: &mut TypeContext) -> Tables
Trait Implementations
impl Clone for Tables
[src]
fn clone(&self) -> Tables
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Union for Tables
[src]
type Output = Tables
A type of the resulting type.
fn union(
&self,
other: &Tables,
explicit: bool,
ctx: &mut TypeContext
) -> TypeResult<Tables>
&self,
other: &Tables,
explicit: bool,
ctx: &mut TypeContext
) -> TypeResult<Tables>
Calculates a union type of self
and other
, explicitly or implicitly. Read more
impl Lattice for Tables
[src]
fn assert_sub(&self, other: &Self, ctx: &mut TypeContext) -> TypeResult<()>
Asserts that self
is a consistent subtype of other
under the type context.
fn assert_eq(&self, other: &Self, ctx: &mut TypeContext) -> TypeResult<()>
Asserts that self
is a consistent type equal to other
under the type context.
impl PartialEq for Tables
[src]
fn eq(&self, other: &Tables) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.