pub struct Executor { /* private fields */ }Expand description
Executor for duplicate processing operations.
Handles rate-limited, concurrent execution of the duplicate processing pipeline:
- Download backup copies of loser assets
- Delete successfully downloaded assets
§Example
use immich_lib::{ImmichClient, Executor};
use immich_lib::models::ExecutionConfig;
let client = ImmichClient::new("https://immich.example.com", "api-key")?;
let config = ExecutionConfig::default();
let executor = Executor::new(client, config);
// Execute analysis results
// let report = executor.execute_all(&analyses).await;Implementations§
Source§impl Executor
impl Executor
Sourcepub fn new(client: ImmichClient, config: ExecutionConfig) -> Self
pub fn new(client: ImmichClient, config: ExecutionConfig) -> Self
Create a new executor with the given client and configuration.
§Arguments
client- The Immich API client to use for operationsconfig- Execution configuration (rate limits, concurrency, backup dir)
Sourcepub async fn execute_all(&self, groups: &[DuplicateAnalysis]) -> ExecutionReport
pub async fn execute_all(&self, groups: &[DuplicateAnalysis]) -> ExecutionReport
Execute processing for all duplicate groups.
Iterates through all groups, downloading backups and deleting duplicates for each. Shows progress via console progress bars.
§Arguments
groups- Slice of duplicate analysis results to process
§Returns
An execution report summarizing all operations and their outcomes.
Sourcepub async fn execute_group(
&self,
analysis: &DuplicateAnalysis,
pb: &ProgressBar,
) -> GroupResult
pub async fn execute_group( &self, analysis: &DuplicateAnalysis, pb: &ProgressBar, ) -> GroupResult
Execute processing for a single duplicate group.
- Consolidates metadata from losers to winner (GPS, datetime, description)
- Downloads backup copies of all loser assets
- Deletes only those that were successfully downloaded
§Arguments
analysis- The duplicate analysis for this grouppb- Progress bar to update with status messages
§Returns
A group result detailing the outcome of each operation.
Auto Trait Implementations§
impl !Freeze for Executor
impl !RefUnwindSafe for Executor
impl !UnwindSafe for Executor
impl Send for Executor
impl Sync for Executor
impl Unpin for Executor
impl UnsafeUnpin for Executor
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> 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>
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