pub struct CrossReferenceIndex { /* private fields */ }Expand description
A cross-reference index for the entire document.
Implementations§
Source§impl CrossReferenceIndex
impl CrossReferenceIndex
Sourcepub fn from_pages(pages: &[Vec<ContentElement>]) -> Self
pub fn from_pages(pages: &[Vec<ContentElement>]) -> Self
Build a cross-reference index from document pages.
Sourcepub fn find_by_heading(&self, query: &str) -> Vec<(usize, &XRefEntry)>
pub fn find_by_heading(&self, query: &str) -> Vec<(usize, &XRefEntry)>
Find elements by heading text (case-insensitive substring match).
Sourcepub fn elements_on_page(&self, page_number: u32) -> Vec<(usize, &XRefEntry)>
pub fn elements_on_page(&self, page_number: u32) -> Vec<(usize, &XRefEntry)>
Get all elements on a given page.
Sourcepub fn heading_count(&self) -> usize
pub fn heading_count(&self) -> usize
Number of headings indexed.
Sourcepub fn page_count(&self) -> usize
pub fn page_count(&self) -> usize
Number of pages with indexed elements.
Trait Implementations§
Source§impl Clone for CrossReferenceIndex
impl Clone for CrossReferenceIndex
Auto Trait Implementations§
impl Freeze for CrossReferenceIndex
impl RefUnwindSafe for CrossReferenceIndex
impl Send for CrossReferenceIndex
impl Sync for CrossReferenceIndex
impl Unpin for CrossReferenceIndex
impl UnsafeUnpin for CrossReferenceIndex
impl UnwindSafe for CrossReferenceIndex
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more