pub struct SpanIndex {
pub elements: Vec<IndexedElement>,
/* private fields */
}Expand description
A source-position index over an ETDL document.
Fields§
§elements: Vec<IndexedElement>Implementations§
Source§impl SpanIndex
impl SpanIndex
Sourcepub fn resolve(&self, key: &SpanKey) -> Option<&IndexedElement>
pub fn resolve(&self, key: &SpanKey) -> Option<&IndexedElement>
Resolve a SpanKey to the recorded element.
Sourcepub fn find_deepest(&self, offset: u32) -> Option<&IndexedElement>
pub fn find_deepest(&self, offset: u32) -> Option<&IndexedElement>
Return the deepest element whose span (or name-token span) contains the given 0-based character offset. “Deepest” = the smallest containing span, preferring reference > field > definition > section on ties.
Sourcepub fn by_identity(&self, tree: &str, id: &str) -> Vec<&IndexedElement>
pub fn by_identity(&self, tree: &str, id: &str) -> Vec<&IndexedElement>
All elements sharing the given identity (tree, id).
Sourcepub fn definition(&self, tree: &str, id: &str) -> Option<&IndexedElement>
pub fn definition(&self, tree: &str, id: &str) -> Option<&IndexedElement>
The single definition element for (tree, id), if any.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SpanIndex
impl RefUnwindSafe for SpanIndex
impl Send for SpanIndex
impl Sync for SpanIndex
impl Unpin for SpanIndex
impl UnsafeUnpin for SpanIndex
impl UnwindSafe for SpanIndex
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