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§impl Debug for SymbolIndex
impl Debug for SymbolIndex
Auto Trait Implementations§
impl Forget for SymbolIndex
impl Freeze for SymbolIndex
impl Move for SymbolIndex
impl RefUnwindSafe for SymbolIndex
impl Send for SymbolIndexwhere
RawVecInner: Send,
impl Sync for SymbolIndexwhere
RawVecInner: Sync,
impl Unpin for SymbolIndex
impl UnsafeUnpin for SymbolIndex
impl UnwindSafe for SymbolIndexwhere
RawVecInner: UnwindSafe,
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