pub enum ConflictStrategy {
Fail,
Skip,
Overwrite,
Append,
}Expand description
Conflict resolution strategy when the output path already exists.
Used by write_to_file() to determine behavior when the target file
is already present on disk.
| Strategy | Behavior |
|---|---|
Fail | Return an error (default — safest) |
Skip | Silently do nothing |
Overwrite | Delete existing file and write new one |
Append | Write to name_1.ext, name_2.ext, etc. |
Variants§
Fail
Return an error if the file exists.
Skip
Silently skip writing if the file exists.
Overwrite
Delete and replace the existing file.
Append
Write to a numbered variant (file_1.ext, file_2.ext, …).
Trait Implementations§
Source§impl Clone for ConflictStrategy
impl Clone for ConflictStrategy
Source§fn clone(&self) -> ConflictStrategy
fn clone(&self) -> ConflictStrategy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConflictStrategy
impl Debug for ConflictStrategy
Source§impl Default for ConflictStrategy
impl Default for ConflictStrategy
Source§fn default() -> ConflictStrategy
fn default() -> ConflictStrategy
Returns the “default value” for a type. Read more
Source§impl Display for ConflictStrategy
impl Display for ConflictStrategy
Source§impl PartialEq for ConflictStrategy
impl PartialEq for ConflictStrategy
impl Copy for ConflictStrategy
impl Eq for ConflictStrategy
impl StructuralPartialEq for ConflictStrategy
Auto Trait Implementations§
impl Freeze for ConflictStrategy
impl RefUnwindSafe for ConflictStrategy
impl Send for ConflictStrategy
impl Sync for ConflictStrategy
impl Unpin for ConflictStrategy
impl UnsafeUnpin for ConflictStrategy
impl UnwindSafe for ConflictStrategy
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.