pub enum TokenValue {
None,
Float(f64),
Int(i64),
Str(GcRef<LuaString>),
}Expand description
Semantic payload carried by a token.
Corresponds to SemInfo (a C union) in llex.h. In Rust this is a
discriminated union (enum).
§C mapping
SemInfo.r → TokenValue::Float(f64) (lua_Number)
SemInfo.i → TokenValue::Int(i64) (lua_Integer)
SemInfo.ts → TokenValue::Str(GcRef<LuaString>)
(no C field) → TokenValue::None (default / unset)Variants§
None
No semantic value (default; used for single-byte and most multi-char tokens).
Float(f64)
Float literal payload. C: seminfo.r (lua_Number).
Int(i64)
Integer literal payload. C: seminfo.i (lua_Integer).
Str(GcRef<LuaString>)
String/name payload. C: seminfo.ts (TString *).
Trait Implementations§
Source§impl Clone for TokenValue
impl Clone for TokenValue
Source§fn clone(&self) -> TokenValue
fn clone(&self) -> TokenValue
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TokenValue
impl !RefUnwindSafe for TokenValue
impl !Send for TokenValue
impl !Sync for TokenValue
impl Unpin for TokenValue
impl UnsafeUnpin for TokenValue
impl !UnwindSafe for TokenValue
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