Re: [PR] refactor!: `copy` & `copy_if_not_exists` => `copy_opts` [arrow-rs-object-store]

2025-11-25 Thread via GitHub


alamb commented on PR #548:
URL: 
https://github.com/apache/arrow-rs-object-store/pull/548#issuecomment-3575644133

   Thanks @crepererum @kylebarron and @tustvold 


-- 
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]



Re: [PR] refactor!: `copy` & `copy_if_not_exists` => `copy_opts` [arrow-rs-object-store]

2025-11-25 Thread via GitHub


alamb merged PR #548:
URL: https://github.com/apache/arrow-rs-object-store/pull/548


-- 
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]



Re: [PR] refactor!: `copy` & `copy_if_not_exists` => `copy_opts` [arrow-rs-object-store]

2025-11-25 Thread via GitHub


alamb commented on PR #548:
URL: 
https://github.com/apache/arrow-rs-object-store/pull/548#issuecomment-3575643411

   Since in my opinion this PR is better than main, I'll merge it in
   
   We can discuss improving the API more on 
   - https://github.com/apache/arrow-rs-object-store/issues/553


-- 
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]



Re: [PR] refactor!: `copy` & `copy_if_not_exists` => `copy_opts` [arrow-rs-object-store]

2025-11-25 Thread via GitHub


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


##
src/lib.rs:
##
@@ -1756,6 +1761,73 @@ pub struct PutResult {
 pub version: Option,
 }
 
+/// 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,

Review Comment:
   - Filed https://github.com/apache/arrow-rs-object-store/issues/553



-- 
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]



Re: [PR] refactor!: `copy` & `copy_if_not_exists` => `copy_opts` [arrow-rs-object-store]

2025-11-25 Thread via GitHub


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


##
src/lib.rs:
##
@@ -1756,6 +1761,73 @@ pub struct PutResult {
 pub version: Option,
 }
 
+/// 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,

Review Comment:
   Given we have a PR here I vote we proceed with this PR and file a ticket to 
track a more easily migratable API going forward. I will file such a ticket



-- 
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]



Re: [PR] refactor!: `copy` & `copy_if_not_exists` => `copy_opts` [arrow-rs-object-store]

2025-11-24 Thread via GitHub


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


##
src/lib.rs:
##
@@ -1756,6 +1761,73 @@ pub struct PutResult {
 pub version: Option,
 }
 
+/// 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,

Review Comment:
   I don't have strong opinions on the matter, I lack the time to drive such an 
initiative myself, but if someone else is willing to do so, I think it would be 
valuable



-- 
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]



Re: [PR] refactor!: `copy` & `copy_if_not_exists` => `copy_opts` [arrow-rs-object-store]

2025-11-24 Thread via GitHub


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


##
src/lib.rs:
##
@@ -1756,6 +1761,73 @@ pub struct PutResult {
 pub version: Option,
 }
 
+/// 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,

Review Comment:
   > We could do this, but I think that's probably a separate ticket, and we'd 
want to do it globally.
   
   So we're now waiting for the ideal solution? Should we do that for 0.13.x?



-- 
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]



Re: [PR] refactor!: `copy` & `copy_if_not_exists` => `copy_opts` [arrow-rs-object-store]

2025-11-22 Thread via GitHub


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


##
src/lib.rs:
##
@@ -1756,6 +1761,73 @@ pub struct PutResult {
 pub version: Option,
 }
 
+/// 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,

Review Comment:
   One possibility would be to setup that style as part of this PR (first for 
CopyOptions) and then apply it to other options / attributes in a series of 
follow on PRs



-- 
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]



Re: [PR] refactor!: `copy` & `copy_if_not_exists` => `copy_opts` [arrow-rs-object-store]

2025-11-21 Thread via GitHub


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


##
src/lib.rs:
##
@@ -1756,6 +1761,73 @@ pub struct PutResult {
 pub version: Option,
 }
 
+/// 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,

Review Comment:
   I think the only way to achieve this would be to make the options 
enumerable, i.e. a list of some non_exhaustive enum, that way implementations 
can error if they encounter an option they don't recognise.
   
   Effectively this would take the pattern of Attributes and apply it more 
broadly.
   
   We could do this, but I think that's probably a separate ticket, and we'd 
want to do it globally.



-- 
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]



Re: [PR] refactor!: `copy` & `copy_if_not_exists` => `copy_opts` [arrow-rs-object-store]

2025-11-21 Thread via GitHub


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


##
src/lib.rs:
##
@@ -1756,6 +1761,73 @@ pub struct PutResult {
 pub version: Option,
 }
 
+/// 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,

Review Comment:
   I think the only way to achieve this would be to make the options 
enumerable, that way implementations can error if they encounter an option they 
don't recognise.
   
   Effectively this would take the pattern of Attributes and apply it more 
broadly.
   
   We could do this, but I think that's probably a separate ticket, and we'd 
want to do it globally.



-- 
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]



Re: [PR] refactor!: `copy` & `copy_if_not_exists` => `copy_opts` [arrow-rs-object-store]

2025-11-21 Thread via GitHub


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


##
src/lib.rs:
##
@@ -1756,6 +1761,73 @@ pub struct PutResult {
 pub version: Option,
 }
 
+/// 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,

Review Comment:
   > TBH I don't see what's the reason for avoiding breaking changes, it's a 
0.x crate after all. And it's the question of "how much breaking" it is. We're 
not re-designing the entire interface for that again.
   
   One rationale is to speed up the adoption downstream -- since object_store 
is "low" in the dependency stack, if we make a breaking change to the API, we 
then need to wait for that breaking change releases in all other downstream 
dependencies
   
   So for example, it can take up to 4 months to get into datafusion (wait 3 
months for next major arrow release and then a month for the next major 
datafusion release)
   
   That timeframe is not a deal breaker nor does it mean we shouldn't make 
breaking changes ever, but I do think it is worth considering as we design APIs



-- 
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]



Re: [PR] refactor!: `copy` & `copy_if_not_exists` => `copy_opts` [arrow-rs-object-store]

2025-11-20 Thread via GitHub


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


##
src/lib.rs:
##
@@ -1756,6 +1761,73 @@ pub struct PutResult {
 pub version: Option,
 }
 
+/// 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,

Review Comment:
   I cannot square the circle here: having a simple API (esp. not having 
hundreds of specialized methods or traits) + no breaking change is IMHO not 
gonna work. TBH I don't see what's the reason for avoiding breaking changes, 
it's a 0.x crate after all. And it's the question of "how much breaking" it is. 
We're not re-designing the entire interface for that again.
   
   Different example: if we would add "attributes" to the copy operation (which 
might be actually happening at one point), then a store implementation HAS TO 
consider them. You cannot just YOLO it and drop that information to the floor. 
Hence, this would be a breaking change, not only because of the interface 
change, but purely based on the fact that there's a semantic change/addition to 
the operation that implementation HAVE TO consider.



-- 
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]



Re: [PR] refactor!: `copy` & `copy_if_not_exists` => `copy_opts` [arrow-rs-object-store]

2025-11-20 Thread via GitHub


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


##
src/lib.rs:
##
@@ -1756,6 +1761,73 @@ pub struct PutResult {
 pub version: Option,
 }
 
+/// 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,

Review Comment:
   > My point was that one of the stated rationales for extracting options into 
CopyOptions is to help enable
   
   The rational is to add such feature easier, not to do it without a breaking 
change at all.



-- 
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]



Re: [PR] refactor!: `copy` & `copy_if_not_exists` => `copy_opts` [arrow-rs-object-store]

2025-11-20 Thread via GitHub


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


##
src/lib.rs:
##
@@ -1756,6 +1761,73 @@ pub struct PutResult {
 pub version: Option,
 }
 
+/// 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,

Review Comment:
   It would be nice to be able to support cross-bucket copies in the future 
without a breaking change if possible



-- 
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]



Re: [PR] refactor!: `copy` & `copy_if_not_exists` => `copy_opts` [arrow-rs-object-store]

2025-11-20 Thread via GitHub


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


##
src/lib.rs:
##
@@ -1756,6 +1761,73 @@ pub struct PutResult {
 pub version: Option,
 }
 
+/// 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,

Review Comment:
   My point was that one of the stated  rationales for extracting options into 
`CopyOptions` is to help enable
   - https://github.com/apache/arrow-rs-object-store/issues/297
   
   However, it seems like if we go with this API we will not be able to add 
fields to CopyOptions to enable cross bucket copying without another breaking 
API change
   
   Perhaps I am missing something



-- 
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]



Re: [PR] refactor!: `copy` & `copy_if_not_exists` => `copy_opts` [arrow-rs-object-store]

2025-11-20 Thread via GitHub


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,
 }
 
+/// 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]



Re: [PR] refactor!: `copy` & `copy_if_not_exists` => `copy_opts` [arrow-rs-object-store]

2025-11-20 Thread via GitHub


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


##
src/lib.rs:
##
@@ -1756,6 +1761,73 @@ pub struct PutResult {
 pub version: Option,
 }
 
+/// 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,

Review Comment:
   Adding new fields IS a breaking change by design, implementations shouldn't 
just ignore them. This is also in line with all the other options structs. This 
is also enforced by fully destructing the options in the respective methods (so 
you cannot forget to handle new fields).



-- 
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]



Re: [PR] refactor!: `copy` & `copy_if_not_exists` => `copy_opts` [arrow-rs-object-store]

2025-11-20 Thread via GitHub


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


##
src/lib.rs:
##
@@ -1756,6 +1761,73 @@ pub struct PutResult {
 pub version: Option,
 }
 
+/// 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 recommend also adding accessors and remove the `pub`  from the fields for 
the reasons listed above



##
src/lib.rs:
##
@@ -1633,7 +1638,7 @@ pub struct PutOptions {
 ///
 /// These extensions are ignored entirely by backends offered through this 
crate.
 ///
-/// They are also eclused from [`PartialEq`] and [`Eq`].
+/// They are also excluded from [`PartialEq`] and [`Eq`].

Review Comment:
   👍 



##
src/lib.rs:
##
@@ -1756,6 +1761,73 @@ pub struct PutResult {
 pub version: Option,
 }
 
+/// 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,

Review Comment:
   If we make all these fields `pub` I don't think we will be able to add new 
fields (e.g a different target object store) without a breaking API change
   
   So I would suggest either marking these as non-pub or marking the struct as 
[`non_exhaustitve`](https://doc.rust-lang.org/reference/attributes/type_system.html#the-non_exhaustive-attribute)
   
   



-- 
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]