pub struct PageRange { /* private fields */ }Expand description
Page range specification for extraction.
Supports individual pages and ranges:
- “1” - single page
- “1-5” - range of pages (inclusive)
- “1,3,5” - multiple individual pages
- “1-5,10-15” - combination of ranges
Implementations§
Source§impl PageRange
impl PageRange
Sourcepub fn parse(s: &str) -> Result<Self>
pub fn parse(s: &str) -> Result<Self>
Parse a page range string.
§Arguments
s- Page range string (e.g., “1-5,10,15-20”)
§Errors
Returns an error if the string format is invalid or contains invalid page numbers.
§Examples
use pdfcat::config::PageRange;
let range = PageRange::parse("1-5,10").unwrap();
assert!(range.contains(3));
assert!(range.contains(10));
assert!(!range.contains(7));Trait Implementations§
Source§impl<'de> Deserialize<'de> for PageRange
impl<'de> Deserialize<'de> for PageRange
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PageRange
impl StructuralPartialEq for PageRange
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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