crepererum commented on code in PR #548:
URL: 
https://github.com/apache/arrow-rs-object-store/pull/548#discussion_r2546895599


##########
src/lib.rs:
##########
@@ -1756,6 +1761,73 @@ pub struct PutResult {
     pub version: Option<String>,
 }
 
+/// Configure preconditions for the copy operation
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
+pub enum CopyMode {
+    /// Perform an atomic write operation, overwriting any object present at 
the provided path
+    #[default]
+    Overwrite,
+    /// Perform an atomic write operation, returning [`Error::AlreadyExists`] 
if an
+    /// object already exists at the provided path
+    Create,
+}
+
+/// Options for a copy request
+#[derive(Debug, Clone, Default)]
+pub struct CopyOptions {
+    /// Configure the [`CopyMode`] for this operation
+    pub mode: CopyMode,
+    /// Implementation-specific extensions. Intended for use by 
[`ObjectStore`] implementations
+    /// that need to pass context-specific information (like tracing spans) 
via trait methods.
+    ///
+    /// These extensions are ignored entirely by backends offered through this 
crate.
+    ///
+    /// They are also excluded from [`PartialEq`] and [`Eq`].
+    pub extensions: Extensions,
+}
+
+impl CopyOptions {
+    /// Create a new [`CopyOptions`]
+    pub fn new() -> Self {
+        Self::default()
+    }
+
+    /// Sets the `mode.
+    ///
+    /// See [`CopyOptions::mode`].
+    #[must_use]
+    pub fn with_mode(mut self, mode: CopyMode) -> Self {
+        self.mode = mode;
+        self
+    }
+
+    /// Sets the `extensions`.
+    ///
+    /// See [`CopyOptions::extensions`].
+    #[must_use]
+    pub fn with_extensions(mut self, extensions: Extensions) -> Self {
+        self.extensions = extensions;
+        self
+    }
+}

Review Comment:
   I disagree as per 
https://github.com/apache/arrow-rs-object-store/pull/548#discussion_r2546894411



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to