pub struct Variable<'input> { /* private fields */ }Expand description
A global variable.
Implementations§
Source§impl<'input> Variable<'input>
impl<'input> Variable<'input>
Sourcepub fn linkage_name(&self) -> Option<&str>
pub fn linkage_name(&self) -> Option<&str>
The linkage name of the variable.
Sourcepub fn symbol_name(&self) -> Option<&str>
pub fn symbol_name(&self) -> Option<&str>
The symbol name of the variable.
This is determined from a symbol table entry with a matching address.
Sourcepub fn ty<'a>(
&self,
hash: &'a FileHash<'input>,
) -> Option<Cow<'a, Type<'input>>>
pub fn ty<'a>( &self, hash: &'a FileHash<'input>, ) -> Option<Cow<'a, Type<'input>>>
The type of the variable.
Returns None if the type is invalid.
Sourcepub fn is_declaration(&self) -> bool
pub fn is_declaration(&self) -> bool
Return true if this is a declaration.
Sourcepub fn cmp_id(
_hash_a: &FileHash<'_>,
a: &Variable<'_>,
_hash_b: &FileHash<'_>,
b: &Variable<'_>,
) -> Ordering
pub fn cmp_id( _hash_a: &FileHash<'_>, a: &Variable<'_>, _hash_b: &FileHash<'_>, b: &Variable<'_>, ) -> Ordering
Compare the identifying information of two variables.
Variables are equal if they have the same namespace and name.
This can be used to sort, and to determine if two variables refer to the same definition (even if there are differences in the definitions).
Trait Implementations§
Auto Trait Implementations§
impl<'input> !Freeze for Variable<'input>
impl<'input> RefUnwindSafe for Variable<'input>
impl<'input> Send for Variable<'input>
impl<'input> Sync for Variable<'input>
impl<'input> Unpin for Variable<'input>
impl<'input> UnwindSafe for Variable<'input>
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