pub struct ExclusiveLockedRunStore<'store> { /* private fields */ }Expand description
A run store that has been locked for exclusive access.
The lifetime parameter ensures this isn’t held for longer than the
corresponding RunStore.
Implementations§
Source§impl<'store> ExclusiveLockedRunStore<'store>
impl<'store> ExclusiveLockedRunStore<'store>
Sourcepub fn runs_dir(&self) -> StoreRunsDir<'store>
pub fn runs_dir(&self) -> StoreRunsDir<'store>
Returns the runs directory.
Sourcepub fn write_permission(&self) -> RunsJsonWritePermission
pub fn write_permission(&self) -> RunsJsonWritePermission
Returns whether this nextest can write to the runs.json.zst file.
If the file has a newer format version than we support, writing is denied.
Sourcepub fn complete_run(
&mut self,
run_id: ReportUuid,
sizes: StoreSizes,
status: RecordedRunStatus,
duration_secs: Option<f64>,
) -> Result<bool, RunStoreError>
pub fn complete_run( &mut self, run_id: ReportUuid, sizes: StoreSizes, status: RecordedRunStatus, duration_secs: Option<f64>, ) -> Result<bool, RunStoreError>
Marks a run as completed and persists the change to disk.
Updates sizes, status, and duration_secs to the given values.
Returns true if the run was found and updated, false if no run
with the given ID exists (in which case nothing is persisted).
Returns an error if writing is denied due to a format version mismatch.
The status should not be Incomplete since we’re completing the run.
Sourcepub fn prune(
&mut self,
policy: &RecordRetentionPolicy,
kind: PruneKind,
) -> Result<PruneResult, RunStoreError>
pub fn prune( &mut self, policy: &RecordRetentionPolicy, kind: PruneKind, ) -> Result<PruneResult, RunStoreError>
Prunes runs according to the given retention policy.
This method:
- Determines which runs to delete based on the policy
- Deletes those run directories from disk
- Deletes any orphaned directories not tracked in runs.json.zst
- Updates the run list in memory and on disk
The kind parameter indicates whether this is explicit pruning (from a
user command) or implicit pruning (automatic during recording). This
affects how errors are displayed.
Returns the result of the pruning operation, including any errors that occurred while deleting individual runs.
Returns an error if writing is denied due to a format version mismatch.
Sourcepub fn prune_if_needed(
&mut self,
policy: &RecordRetentionPolicy,
) -> Result<Option<PruneResult>, RunStoreError>
pub fn prune_if_needed( &mut self, policy: &RecordRetentionPolicy, ) -> Result<Option<PruneResult>, RunStoreError>
Prunes runs if needed, based on time since last prune and limit thresholds.
This method implements implicit pruning, which occurs:
- If more than 1 day has passed since the last prune, OR
- If any retention limit is exceeded by 1.5x.
Use Self::prune for explicit pruning that always runs regardless of these conditions.
Returns Ok(None) if pruning was skipped, Ok(Some(result)) if pruning occurred.
Trait Implementations§
Auto Trait Implementations§
impl<'store> Freeze for ExclusiveLockedRunStore<'store>
impl<'store> RefUnwindSafe for ExclusiveLockedRunStore<'store>
impl<'store> Send for ExclusiveLockedRunStore<'store>
impl<'store> Sync for ExclusiveLockedRunStore<'store>
impl<'store> Unpin for ExclusiveLockedRunStore<'store>
impl<'store> UnwindSafe for ExclusiveLockedRunStore<'store>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more