pub struct JobStore { /* private fields */ }Implementations§
Source§impl JobStore
impl JobStore
pub fn open_default() -> Result<Self>
pub fn open(path: impl Into<PathBuf>) -> Result<Self>
pub fn path(&self) -> &Path
pub fn create_job(&self, request: CreateJob<'_>) -> Result<JobRecord>
pub fn update_job_config_snapshot( &self, job_id: &str, snapshot: &RunConfigSnapshot, ) -> Result<()>
pub fn update_job_input_snapshot( &self, job_id: &str, snapshot_path: &Path, input_sha256: &str, ) -> Result<()>
pub fn load_job_config_snapshot( &self, job_id: &str, ) -> Result<Option<RunConfigSnapshot>>
pub fn update_job_event_path(&self, job_id: &str, path: &Path) -> Result<()>
pub fn update_job_report_paths( &self, job_id: &str, json_path: &Path, markdown_path: &Path, ) -> Result<()>
pub fn update_job_output_path(&self, job_id: &str, path: &Path) -> Result<()>
pub fn insert_segments( &self, job_id: &str, segments: &[Segment], prompt_version: &str, provider: &str, model: &str, cache_namespace: &str, ) -> Result<()>
pub fn save_translation(&self, request: SaveTranslation<'_>) -> Result<()>
pub fn save_needs_review(&self, request: SaveNeedsReview<'_>) -> Result<()>
pub fn save_cached_translation( &self, request: SaveCachedTranslation<'_>, ) -> Result<()>
pub fn mark_job_complete(&self, job_id: &str) -> Result<()>
pub fn mark_job_running(&self, job_id: &str) -> Result<()>
pub fn mark_job_succeeded(&self, job_id: &str) -> Result<()>
pub fn mark_job_needs_review(&self, job_id: &str) -> Result<()>
pub fn mark_job_interrupted(&self, job_id: &str) -> Result<()>
pub fn mark_job_failed(&self, job_id: &str) -> Result<()>
pub fn mark_segment_failed( &self, job_id: &str, segment_id: &str, error: &str, ) -> Result<()>
pub fn mark_segment_failed_if_unfinished( &self, job_id: &str, segment_id: &str, error: &str, ) -> Result<()>
pub fn mark_unfinished_segments_failed( &self, job_id: &str, candidate_segment_ids: &[String], error: &str, ) -> Result<usize>
pub fn get_job(&self, job_id: &str) -> Result<Option<JobRecord>>
pub fn summary(&self, job_id: &str) -> Result<Option<JobSummary>>
pub fn retry_segments(&self, job_id: &str, scope: RetryScope) -> Result<usize>
pub fn insert_segment_flags( &self, flags: &[NewSegmentFlag<'_>], ) -> Result<usize>
pub fn mark_segments_needs_review( &self, job_id: &str, segment_ids: &[String], reason: &str, ) -> Result<usize>
pub fn segment_flag_count(&self, job_id: &str) -> Result<usize>
pub fn upsert_glossary_terms(&self, terms: &[GlossaryTerm]) -> Result<usize>
pub fn add_glossary_term(&self, term: &GlossaryTerm) -> Result<i64>
pub fn upsert_glossary_candidates( &self, book_id: &str, source_language: &str, target_language: &str, candidates: &[NewGlossaryCandidate<'_>], ) -> Result<GlossaryCandidateUpsertResult>
pub fn list_glossary_candidate_language_pairs( &self, book_id: &str, ) -> Result<Vec<(String, String)>>
pub fn list_glossary_candidates( &self, book_id: &str, source_language: &str, target_language: &str, ) -> Result<Vec<StoredGlossaryCandidate>>
pub fn accept_glossary_candidate( &self, id: i64, target_text: Option<&str>, ) -> Result<bool>
pub fn reject_glossary_candidate(&self, id: i64) -> Result<bool>
pub fn list_glossary_terms( &self, filter: GlossaryFilter<'_>, ) -> Result<Vec<GlossaryTerm>>
pub fn load_active_glossary_terms( &self, source_language: &str, target_language: &str, book_id: Option<&str>, series_id: Option<&str>, ) -> Result<Vec<GlossaryTerm>>
pub fn load_active_glossary_terms_for_target( &self, target_language: &str, book_id: Option<&str>, series_id: Option<&str>, ) -> Result<Vec<GlossaryTerm>>
pub fn remove_glossary_term(&self, id: i64) -> Result<usize>
pub fn clear_glossary_scope( &self, scope_kind: GlossaryScopeKind, scope_id: Option<&str>, ) -> Result<usize>
Sourcepub fn upsert_style_sheet(&self, record: &NewStyleSheet<'_>) -> Result<i64>
pub fn upsert_style_sheet(&self, record: &NewStyleSheet<'_>) -> Result<i64>
Upsert a style sheet for a (scope, target_language) tuple. Returns the row id of the inserted/updated row.
Sourcepub fn load_active_style_sheets(
&self,
target_language: &str,
book_id: Option<&str>,
series_id: Option<&str>,
) -> Result<Vec<StoredStyleSheet>>
pub fn load_active_style_sheets( &self, target_language: &str, book_id: Option<&str>, series_id: Option<&str>, ) -> Result<Vec<StoredStyleSheet>>
Load all style sheets that apply for a given language pair and
optional book/series scopes. Caller is responsible for merging via
bookforge_core::style::merge_style_sheets.
pub fn list_style_sheets( &self, target_language: Option<&str>, scope_kind: Option<GlossaryScopeKind>, scope_id: Option<&str>, ) -> Result<Vec<StoredStyleSheet>>
pub fn clear_style_scope( &self, scope_kind: GlossaryScopeKind, scope_id: Option<&str>, ) -> Result<usize>
pub fn upsert_entities(&self, entities: &[NewEntity<'_>]) -> Result<usize>
Sourcepub fn load_active_entities(
&self,
source_language: &str,
target_language: &str,
book_id: Option<&str>,
series_id: Option<&str>,
) -> Result<Vec<StoredEntity>>
pub fn load_active_entities( &self, source_language: &str, target_language: &str, book_id: Option<&str>, series_id: Option<&str>, ) -> Result<Vec<StoredEntity>>
Load all entities that apply for a language pair and optional
book/series scopes. Caller is responsible for merging via
bookforge_core::entity::merge_scope_entities.
pub fn list_entities( &self, source_language: Option<&str>, target_language: Option<&str>, scope_kind: Option<GlossaryScopeKind>, scope_id: Option<&str>, ) -> Result<Vec<StoredEntity>>
pub fn clear_entities_scope( &self, scope_kind: GlossaryScopeKind, scope_id: Option<&str>, ) -> Result<usize>
pub fn pending_segment_ids(&self, job_id: &str) -> Result<Vec<String>>
pub fn segment_records(&self, job_id: &str) -> Result<Vec<SegmentRecord>>
pub fn load_block_translations( &self, job_id: &str, ) -> Result<Vec<StoredBlockTranslation>>
pub fn load_terminal_segment_translations( &self, job_id: &str, ) -> Result<Vec<StoredSegmentTranslation>>
pub fn resumable_segment_ids(&self, job_id: &str) -> Result<Vec<String>>
pub fn find_cached_translation( &self, segment: &Segment, prompt_version: &str, provider: &str, model: &str, source_lang: Option<&str>, target_lang: &str, cache_namespace: &str, ) -> Result<Option<CachedTranslation>>
pub fn find_cached_translations_batch( &self, segments: &[Segment], request: CacheLookupRequest<'_>, ) -> Result<HashMap<String, CachedTranslation>>
Auto Trait Implementations§
impl !Freeze for JobStore
impl !RefUnwindSafe for JobStore
impl !Sync for JobStore
impl !UnwindSafe for JobStore
impl Send for JobStore
impl Unpin for JobStore
impl UnsafeUnpin for JobStore
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