pub struct RenameEngine { /* private fields */ }Expand description
Main rename engine that handles file analysis and renaming
Implementations§
Source§impl RenameEngine
impl RenameEngine
Sourcepub fn new(config: RenameConfig) -> Self
pub fn new(config: RenameConfig) -> Self
Create a new rename engine with the given configuration
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a rename engine with default configuration
Sourcepub fn analyze_directory(&self, directory: &Path) -> Result<Vec<FileAnalysis>>
pub fn analyze_directory(&self, directory: &Path) -> Result<Vec<FileAnalysis>>
Analyze all files in a directory and return proposed renames This does not perform any actual renaming - use for preview
Sourcepub fn rename_files(
&self,
analyses: &[FileAnalysis],
dry_run: bool,
) -> Vec<RenameResult>
pub fn rename_files( &self, analyses: &[FileAnalysis], dry_run: bool, ) -> Vec<RenameResult>
Rename files based on analysis results Only renames files where analysis.proposed_name is Some()
Sourcepub fn rename_files_with_history(
&self,
analyses: &[FileAnalysis],
dry_run: bool,
history: Option<&mut RenameHistory>,
) -> Vec<RenameResult>
pub fn rename_files_with_history( &self, analyses: &[FileAnalysis], dry_run: bool, history: Option<&mut RenameHistory>, ) -> Vec<RenameResult>
Rename files with history tracking If history is provided, successful renames will be added to the history
Sourcepub fn process_directory(
&self,
directory: &Path,
dry_run: bool,
) -> Result<Vec<RenameResult>>
pub fn process_directory( &self, directory: &Path, dry_run: bool, ) -> Result<Vec<RenameResult>>
Analyze and rename files in one step (like the original CLI behavior)
Auto Trait Implementations§
impl Freeze for RenameEngine
impl RefUnwindSafe for RenameEngine
impl Send for RenameEngine
impl Sync for RenameEngine
impl Unpin for RenameEngine
impl UnwindSafe for RenameEngine
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