pub struct GridArrayReader { /* private fields */ }Expand description
Provides random access to individual GridArrays in a compressed file without loading the entire collection.
Useful for efficient access to large PDF sets where only a subset of members is needed.
Implementations§
Source§impl GridArrayReader
impl GridArrayReader
Sourcepub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, Box<dyn Error>>
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, Box<dyn Error>>
Creates a new reader from a file, enabling random access to grid members.
This method automatically handles backward compatibility with v0.2.0 files. If reading with the current format fails, it falls back to using the legacy loader.
§Arguments
path- Input file path.
§Returns
A GridArrayReader instance on success, or an error if reading fails.
Sourcepub fn load_grid(
&self,
index: usize,
) -> Result<GridArrayWithMetadata, Box<dyn Error>>
pub fn load_grid( &self, index: usize, ) -> Result<GridArrayWithMetadata, Box<dyn Error>>
Loads a specific GridArrayWithMetadata by index.
§Arguments
index- The index of the grid to load.
§Returns
The requested GridArrayWithMetadata on success, or an error if the
index is out of bounds or reading fails.
Auto Trait Implementations§
impl Freeze for GridArrayReader
impl RefUnwindSafe for GridArrayReader
impl Send for GridArrayReader
impl Sync for GridArrayReader
impl Unpin for GridArrayReader
impl UnsafeUnpin for GridArrayReader
impl UnwindSafe for GridArrayReader
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<T> ErasedDestructor for Twhere
T: 'static,
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