pub enum Key {
Bool(bool),
Number(f64),
Str(Vec<u8>),
Table(Table),
Function(Func),
Global(Global),
}Expand description
A table key. Only hashable Lua values can be keys.
Numbers, booleans, and strings hash by value. Tables and functions hash by identity, matching Lua reference semantics.
Equality follows the same split. Scalar keys compare by value, reference keys
by identity. Key::same is the same relation expressed as a method.
Variants§
Bool(bool)
Boolean key.
Number(f64)
Numeric key.
Str(Vec<u8>)
String key.
Table(Table)
Table key, tracked by identity.
Function(Func)
Function key, tracked by identity.
Global(Global)
Global-named key such as io.stdin.
Implementations§
Trait Implementations§
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl !RefUnwindSafe for Key
impl !Send for Key
impl !Sync for Key
impl !UnwindSafe for Key
impl Freeze for Key
impl Unpin for Key
impl UnsafeUnpin for Key
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more