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
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