pub struct ReprocessState {
pub source_pdf: PathBuf,
pub output_dir: PathBuf,
pub pages: Vec<PageStatus>,
pub config_hash: String,
pub created_at: String,
pub updated_at: String,
}Expand description
Partial reprocessing state
Fields§
§source_pdf: PathBufSource PDF path
output_dir: PathBufOutput directory
pages: Vec<PageStatus>Page statuses (0-indexed)
config_hash: StringProcessing configuration hash (for cache invalidation)
created_at: StringCreation timestamp (ISO 8601)
updated_at: StringLast updated timestamp (ISO 8601)
Implementations§
Source§impl ReprocessState
impl ReprocessState
Sourcepub fn new(
source_pdf: PathBuf,
output_dir: PathBuf,
page_count: usize,
config_hash: String,
) -> Self
pub fn new( source_pdf: PathBuf, output_dir: PathBuf, page_count: usize, config_hash: String, ) -> Self
Create a new ReprocessState for a PDF
Sourcepub fn failed_pages(&self) -> Vec<usize>
pub fn failed_pages(&self) -> Vec<usize>
Get indices of failed pages
Sourcepub fn success_pages(&self) -> Vec<usize>
pub fn success_pages(&self) -> Vec<usize>
Get indices of successful pages
Sourcepub fn pending_pages(&self) -> Vec<usize>
pub fn pending_pages(&self) -> Vec<usize>
Get indices of pending pages
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if all pages are successfully processed
Sourcepub fn completion_percent(&self) -> f64
pub fn completion_percent(&self) -> f64
Get completion percentage (0.0 - 100.0)
Sourcepub fn page_count(&self) -> usize
pub fn page_count(&self) -> usize
Get total page count
Sourcepub fn mark_success(
&mut self,
page_idx: usize,
cached_path: PathBuf,
processing_time: f64,
) -> Result<()>
pub fn mark_success( &mut self, page_idx: usize, cached_path: PathBuf, processing_time: f64, ) -> Result<()>
Mark a page as successful
Sourcepub fn mark_failed(
&mut self,
page_idx: usize,
error: impl Into<String>,
) -> Result<()>
pub fn mark_failed( &mut self, page_idx: usize, error: impl Into<String>, ) -> Result<()>
Mark a page as failed
Sourcepub fn increment_retry(&mut self, page_idx: usize) -> Result<()>
pub fn increment_retry(&mut self, page_idx: usize) -> Result<()>
Increment retry count for a page
Sourcepub fn cached_paths(&self) -> Vec<Option<PathBuf>>
pub fn cached_paths(&self) -> Vec<Option<PathBuf>>
Get cached paths for all successful pages
Sourcepub fn config_changed(&self, new_hash: &str) -> bool
pub fn config_changed(&self, new_hash: &str) -> bool
Check if config has changed (requires reprocessing)
Sourcepub fn invalidate_all(&mut self)
pub fn invalidate_all(&mut self)
Invalidate all pages (mark as Pending)
Trait Implementations§
Source§impl Clone for ReprocessState
impl Clone for ReprocessState
Source§fn clone(&self) -> ReprocessState
fn clone(&self) -> ReprocessState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReprocessState
impl Debug for ReprocessState
Source§impl Default for ReprocessState
impl Default for ReprocessState
Source§impl<'de> Deserialize<'de> for ReprocessState
impl<'de> Deserialize<'de> for ReprocessState
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
Auto Trait Implementations§
impl Freeze for ReprocessState
impl RefUnwindSafe for ReprocessState
impl Send for ReprocessState
impl Sync for ReprocessState
impl Unpin for ReprocessState
impl UnwindSafe for ReprocessState
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> 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().