Skip to main content

JobStore

Struct JobStore 

Source
pub struct JobStore { /* private fields */ }

Implementations§

Source§

impl JobStore

Source

pub fn open_default() -> Result<Self>

Source

pub fn open(path: impl Into<PathBuf>) -> Result<Self>

Source

pub fn path(&self) -> &Path

Source

pub fn create_job(&self, request: CreateJob<'_>) -> Result<JobRecord>

Source

pub fn update_job_config_snapshot( &self, job_id: &str, snapshot: &RunConfigSnapshot, ) -> Result<()>

Source

pub fn update_job_input_snapshot( &self, job_id: &str, snapshot_path: &Path, input_sha256: &str, ) -> Result<()>

Source

pub fn load_job_config_snapshot( &self, job_id: &str, ) -> Result<Option<RunConfigSnapshot>>

Source

pub fn update_job_event_path(&self, job_id: &str, path: &Path) -> Result<()>

Source

pub fn update_job_report_paths( &self, job_id: &str, json_path: &Path, markdown_path: &Path, ) -> Result<()>

Source

pub fn update_job_output_path(&self, job_id: &str, path: &Path) -> Result<()>

Source

pub fn insert_segments( &self, job_id: &str, segments: &[Segment], prompt_version: &str, provider: &str, model: &str, cache_namespace: &str, ) -> Result<()>

Source

pub fn save_translation(&self, request: SaveTranslation<'_>) -> Result<()>

Source

pub fn save_needs_review(&self, request: SaveNeedsReview<'_>) -> Result<()>

Source

pub fn save_cached_translation( &self, request: SaveCachedTranslation<'_>, ) -> Result<()>

Source

pub fn mark_job_complete(&self, job_id: &str) -> Result<()>

Source

pub fn mark_job_running(&self, job_id: &str) -> Result<()>

Source

pub fn mark_job_succeeded(&self, job_id: &str) -> Result<()>

Source

pub fn mark_job_needs_review(&self, job_id: &str) -> Result<()>

Source

pub fn mark_job_interrupted(&self, job_id: &str) -> Result<()>

Source

pub fn mark_job_failed(&self, job_id: &str) -> Result<()>

Source

pub fn mark_segment_failed( &self, job_id: &str, segment_id: &str, error: &str, ) -> Result<()>

Source

pub fn mark_segment_failed_if_unfinished( &self, job_id: &str, segment_id: &str, error: &str, ) -> Result<()>

Source

pub fn mark_unfinished_segments_failed( &self, job_id: &str, candidate_segment_ids: &[String], error: &str, ) -> Result<usize>

Source

pub fn get_job(&self, job_id: &str) -> Result<Option<JobRecord>>

Source

pub fn summary(&self, job_id: &str) -> Result<Option<JobSummary>>

Source

pub fn retry_segments(&self, job_id: &str, scope: RetryScope) -> Result<usize>

Source

pub fn insert_segment_flags( &self, flags: &[NewSegmentFlag<'_>], ) -> Result<usize>

Source

pub fn mark_segments_needs_review( &self, job_id: &str, segment_ids: &[String], reason: &str, ) -> Result<usize>

Source

pub fn segment_flag_count(&self, job_id: &str) -> Result<usize>

Source

pub fn pending_segment_ids(&self, job_id: &str) -> Result<Vec<String>>

Source

pub fn segment_records(&self, job_id: &str) -> Result<Vec<SegmentRecord>>

Source

pub fn load_block_translations( &self, job_id: &str, ) -> Result<Vec<StoredBlockTranslation>>

Source

pub fn load_terminal_segment_translations( &self, job_id: &str, ) -> Result<Vec<StoredSegmentTranslation>>

Source

pub fn resumable_segment_ids(&self, job_id: &str) -> Result<Vec<String>>

Source

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

Source

pub fn find_cached_translations_batch( &self, segments: &[Segment], request: CacheLookupRequest<'_>, ) -> Result<HashMap<String, CachedTranslation>>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.