pub struct LocalTable { /* private fields */ }Expand description
Flat ordered list of all variable declarations within a script.
entries is pub(crate) rather than pub so the storage shape
(currently a Vec<LocalEntry>) can change without breaking external
consumers. Read access from inside the crate goes through
entries(); mutations go through push_param / push_local.
Implementations§
Source§impl LocalTable
impl LocalTable
pub fn new() -> Self
Sourcepub fn entries(&self) -> &[LocalEntry]
pub fn entries(&self) -> &[LocalEntry]
Read-only view of the ordered local entries. Use this for iteration.
pub fn push_param(&mut self, name: String, param_type: Type) -> i32
pub fn push_local( &mut self, name: String, var_type: Type, is_array: bool, ) -> i32
Sourcepub fn get_variable_id(&self, index: usize) -> i32
pub fn get_variable_id(&self, index: usize) -> i32
Matches TS getVariableId for an existing entry by index.
Sourcepub fn get_local_count(&self, base: BaseVarType) -> u16
pub fn get_local_count(&self, base: BaseVarType) -> u16
Matches TS getLocalCount.
Sourcepub fn get_param_count(&self, base: BaseVarType) -> u16
pub fn get_param_count(&self, base: BaseVarType) -> u16
Matches TS getParameterCount.
Trait Implementations§
Source§impl Clone for LocalTable
impl Clone for LocalTable
Source§fn clone(&self) -> LocalTable
fn clone(&self) -> LocalTable
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 moreSource§impl Debug for LocalTable
impl Debug for LocalTable
Source§impl Default for LocalTable
impl Default for LocalTable
Source§fn default() -> LocalTable
fn default() -> LocalTable
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LocalTable
impl RefUnwindSafe for LocalTable
impl Send for LocalTable
impl Sync for LocalTable
impl Unpin for LocalTable
impl UnsafeUnpin for LocalTable
impl UnwindSafe for LocalTable
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