pub enum PageRange {
All,
Single(usize),
Range(usize, usize),
List(Vec<usize>),
}Expand description
Page range specification
Variants§
All
All pages
Single(usize)
Single page (0-based index)
Range(usize, usize)
Range of pages (inclusive, 0-based)
List(Vec<usize>)
List of specific pages (0-based indices)
Implementations§
Source§impl PageRange
impl PageRange
Sourcepub fn parse(s: &str) -> Result<Self, OperationError>
pub fn parse(s: &str) -> Result<Self, OperationError>
Parse a page range from a string
Examples:
- “all” -> All pages
- “1” -> Single page (converts to 0-based)
- “1-5” -> Range of pages (converts to 0-based)
- “1,3,5” -> List of pages (converts to 0-based)
Sourcepub fn get_indices(
&self,
total_pages: usize,
) -> Result<Vec<usize>, OperationError>
pub fn get_indices( &self, total_pages: usize, ) -> Result<Vec<usize>, OperationError>
Get the page indices for this range
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PageRange
impl RefUnwindSafe for PageRange
impl Send for PageRange
impl Sync for PageRange
impl Unpin for PageRange
impl UnwindSafe for PageRange
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