You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by mn...@apache.org on 2025/04/14 08:30:53 UTC

(arrow-rs-object-store) branch crepererum/public_utils created (now 7860084)

This is an automated email from the ASF dual-hosted git repository.

mneumann pushed a change to branch crepererum/public_utils
in repository https://gitbox.apache.org/repos/asf/arrow-rs-object-store.git


      at 7860084  feat: make `GetOptions::check_precondition` public

This branch includes the following new commits:

     new 4ecea9f  feat: make `GetRange` helpers public
     new 7860084  feat: make `GetOptions::check_precondition` public

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(arrow-rs-object-store) 01/02: feat: make `GetRange` helpers public

Posted by mn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mneumann pushed a commit to branch crepererum/public_utils
in repository https://gitbox.apache.org/repos/asf/arrow-rs-object-store.git

commit 4ecea9f3644c5c2e34dc9a24e418658321a9c9cf
Author: Marco Neumann <ma...@crepererum.net>
AuthorDate: Tue Apr 1 14:57:18 2025 +0200

    feat: make `GetRange` helpers public
---
 src/util.rs | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/util.rs b/src/util.rs
index f46c959..4f297d9 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -208,7 +208,8 @@ pub enum GetRange {
 }
 
 #[derive(Debug, thiserror::Error)]
-pub(crate) enum InvalidGetRange {
+#[non_exhaustive]
+pub enum InvalidGetRange {
     #[error("Wanted range starting at {requested}, but object was only {length} bytes long")]
     StartTooLarge { requested: u64, length: u64 },
 
@@ -220,7 +221,8 @@ pub(crate) enum InvalidGetRange {
 }
 
 impl GetRange {
-    pub(crate) fn is_valid(&self) -> Result<(), InvalidGetRange> {
+    /// Check if the range is valid.
+    pub fn is_valid(&self) -> Result<(), InvalidGetRange> {
         if let Self::Bounded(r) = self {
             if r.end <= r.start {
                 return Err(InvalidGetRange::Inconsistent {
@@ -238,8 +240,8 @@ impl GetRange {
         Ok(())
     }
 
-    /// Convert to a [`Range`] if valid.
-    pub(crate) fn as_range(&self, len: u64) -> Result<Range<u64>, InvalidGetRange> {
+    /// Convert to a [`Range`] if [valid](Self::is_valid).
+    pub fn as_range(&self, len: u64) -> Result<Range<u64>, InvalidGetRange> {
         self.is_valid()?;
         match self {
             Self::Bounded(r) => {


(arrow-rs-object-store) 02/02: feat: make `GetOptions::check_precondition` public

Posted by mn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mneumann pushed a commit to branch crepererum/public_utils
in repository https://gitbox.apache.org/repos/asf/arrow-rs-object-store.git

commit 7860084e17324f3ec28028e9f73d730cc562c5d2
Author: Marco Neumann <ma...@crepererum.net>
AuthorDate: Mon Apr 14 10:26:03 2025 +0200

    feat: make `GetOptions::check_precondition` public
---
 src/lib.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib.rs b/src/lib.rs
index ec660df..66575b8 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -976,7 +976,7 @@ impl GetOptions {
     /// Returns an error if the modification conditions on this request are not satisfied
     ///
     /// <https://datatracker.ietf.org/doc/html/rfc7232#section-6>
-    fn check_preconditions(&self, meta: &ObjectMeta) -> Result<()> {
+    pub fn check_preconditions(&self, meta: &ObjectMeta) -> Result<()> {
         // The use of the invalid etag "*" means no ETag is equivalent to never matching
         let etag = meta.e_tag.as_deref().unwrap_or("*");
         let last_modified = meta.last_modified;