pub struct SymbolTable { /* private fields */ }Expand description
Known global symbols and their fields, populated from Lua VM introspection or manual registration.
Implementations§
Source§impl SymbolTable
impl SymbolTable
pub fn new() -> Self
Sourcepub fn add_global(&mut self, name: &str)
pub fn add_global(&mut self, name: &str)
Register a top-level global name.
Sourcepub fn add_global_field(&mut self, table: &str, field: &str)
pub fn add_global_field(&mut self, table: &str, field: &str)
Register a field of a global table.
Sourcepub fn has_global(&self, name: &str) -> bool
pub fn has_global(&self, name: &str) -> bool
Check whether a top-level global name is known.
Sourcepub fn has_global_field(&self, table: &str, field: &str) -> bool
pub fn has_global_field(&self, table: &str, field: &str) -> bool
Check whether a field of a global table is known.
Sourcepub fn global_fields_for(&self, table: &str) -> Option<&HashSet<String>>
pub fn global_fields_for(&self, table: &str) -> Option<&HashSet<String>>
Get all known fields for a global table (for “did you mean?” suggestions).
Sourcepub fn add_class(&mut self, class_name: &str)
pub fn add_class(&mut self, class_name: &str)
Register a ---@class definition (creates an empty field set if new).
Sourcepub fn add_class_field(&mut self, class_name: &str, field: &str)
pub fn add_class_field(&mut self, class_name: &str, field: &str)
Register a field on a ---@class.
Sourcepub fn has_class_field(&self, class_name: &str, field: &str) -> bool
pub fn has_class_field(&self, class_name: &str, field: &str) -> bool
Check whether a field exists on a class.
Sourcepub fn class_fields_for(&self, class_name: &str) -> Option<&HashSet<String>>
pub fn class_fields_for(&self, class_name: &str) -> Option<&HashSet<String>>
Get all known fields for a class (for “did you mean?” suggestions).
Sourcepub fn with_lua54_stdlib(self) -> Self
pub fn with_lua54_stdlib(self) -> Self
Pre-populate with Lua 5.4 standard library globals.
Trait Implementations§
Source§impl Clone for SymbolTable
impl Clone for SymbolTable
Source§fn clone(&self) -> SymbolTable
fn clone(&self) -> SymbolTable
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SymbolTable
impl Debug for SymbolTable
Source§impl Default for SymbolTable
impl Default for SymbolTable
Source§fn default() -> SymbolTable
fn default() -> SymbolTable
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SymbolTable
impl RefUnwindSafe for SymbolTable
impl Send for SymbolTable
impl Sync for SymbolTable
impl Unpin for SymbolTable
impl UnsafeUnpin for SymbolTable
impl UnwindSafe for SymbolTable
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more