pub struct PageNumberResolver { /* private fields */ }Expand description
Tracks page numbers for elements with IDs and resolves page-number-citations
Implementations§
Source§impl PageNumberResolver
impl PageNumberResolver
Sourcepub fn set_current_page(&mut self, page: usize)
pub fn set_current_page(&mut self, page: usize)
Set the current page number
Sourcepub fn current_page(&self) -> usize
pub fn current_page(&self) -> usize
Get the current page number
Sourcepub fn set_current_format(&mut self, format: String)
pub fn set_current_format(&mut self, format: String)
Set the current page number format
Sourcepub fn current_format(&self) -> &str
pub fn current_format(&self) -> &str
Get the current page number format
Sourcepub fn register_element(&mut self, id: String, area_id: AreaId)
pub fn register_element(&mut self, id: String, area_id: AreaId)
Register an element with an ID on the current page
Sourcepub fn get_format_for_id(&self, id: &str) -> Option<&str>
pub fn get_format_for_id(&self, id: &str) -> Option<&str>
Get the page number format that was active when the element was registered
Sourcepub fn set_current_grouping_separator(&mut self, sep: Option<char>)
pub fn set_current_grouping_separator(&mut self, sep: Option<char>)
Set the current grouping separator
Sourcepub fn current_grouping_separator(&self) -> Option<char>
pub fn current_grouping_separator(&self) -> Option<char>
Get the current grouping separator
Sourcepub fn set_current_grouping_size(&mut self, size: Option<usize>)
pub fn set_current_grouping_size(&mut self, size: Option<usize>)
Set the current grouping size
Sourcepub fn current_grouping_size(&self) -> Option<usize>
pub fn current_grouping_size(&self) -> Option<usize>
Get the current grouping size
Sourcepub fn register_citation(&mut self, area_id: AreaId, ref_id: String)
pub fn register_citation(&mut self, area_id: AreaId, ref_id: String)
Register a page-number-citation that needs to be resolved
Sourcepub fn get_page_number(&self, ref_id: &str) -> Option<usize>
pub fn get_page_number(&self, ref_id: &str) -> Option<usize>
Get the page number for a referenced element
Sourcepub fn get_citations(&self) -> &[(AreaId, String)]
pub fn get_citations(&self) -> &[(AreaId, String)]
Get all citations that need to be resolved
Sourcepub fn can_resolve_all(&self) -> bool
pub fn can_resolve_all(&self) -> bool
Check if all citations can be resolved
Sourcepub fn unresolved_citations(&self) -> Vec<String>
pub fn unresolved_citations(&self) -> Vec<String>
Get a list of unresolved citations
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PageNumberResolver
impl RefUnwindSafe for PageNumberResolver
impl Send for PageNumberResolver
impl Sync for PageNumberResolver
impl Unpin for PageNumberResolver
impl UnsafeUnpin for PageNumberResolver
impl UnwindSafe for PageNumberResolver
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
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().