pub struct SymbolIndex {
pub defs: Vec<(String, usize, usize)>,
pub refs: Vec<(String, usize, usize)>,
}Fields§
§defs: Vec<(String, usize, usize)>(name, start_byte, end_byte)
refs: Vec<(String, usize, usize)>Implementations§
Source§impl SymbolIndex
impl SymbolIndex
pub fn from_tree(tree: &Tree, source: &[u8]) -> Self
Sourcepub fn first_definition(&self, name: &str) -> Option<(usize, usize)>
pub fn first_definition(&self, name: &str) -> Option<(usize, usize)>
First definition span in this index for name (stable file order).
pub fn all_references(&self, name: &str) -> Vec<(usize, usize)>
pub fn reference_at(&self, byte_offset: usize) -> Option<&str>
pub fn definition_at(&self, byte_offset: usize) -> Option<&str>
Trait Implementations§
Source§impl Clone for SymbolIndex
impl Clone for SymbolIndex
Source§fn clone(&self) -> SymbolIndex
fn clone(&self) -> SymbolIndex
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 SymbolIndex
impl Debug for SymbolIndex
Source§impl Default for SymbolIndex
impl Default for SymbolIndex
Source§fn default() -> SymbolIndex
fn default() -> SymbolIndex
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SymbolIndex
impl RefUnwindSafe for SymbolIndex
impl Send for SymbolIndex
impl Sync for SymbolIndex
impl Unpin for SymbolIndex
impl UnsafeUnpin for SymbolIndex
impl UnwindSafe for SymbolIndex
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