You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "stayrascal (via GitHub)" <gi...@apache.org> on 2025/04/05 02:25:48 UTC

Re: [I] Add ObjectStore::list_opts [arrow-rs-object-store]

stayrascal commented on issue #295:
URL: https://github.com/apache/arrow-rs-object-store/issues/295#issuecomment-2780147007

   I'm trying to add the `list_opts`, but meet a problem about `Extensions` during passing it into a closure, which need the `Extensions` implemented `std::marker::Copy` trait, for example, the `list_paginated` method of `ListClientExt` will continue calling `list_request` in a closure to continue pull list result from object, if we add the `Extensions` parameter to `list_request` method of `ListClient`, which required the passed parameters are copied. So it looks that it's hard to add a `Extensions` parameter. 
   
   BTW, why don't using a `Option<HashMap>` instead of `Extensions` during defined the xxxOptions and covert it to `Extensions` and setting in http client builder, since after add the `Extensions` into some options, e.g. PutOptions, PutMultipartOpts, we have to re-implementation PartialEq and Eq trait. (I'm a newbie about Rust, didn't get what's means ' // That's 3 words. Instead, this is only 1 word.' below)
   ```
   /// A type map of protocol extensions.
   ///
   /// `Extensions` can be used by `Request` and `Response` to store
   /// extra data derived from the underlying protocol.
   #[derive(Clone, Default)]
   pub struct Extensions {
       // If extensions are never used, no need to carry around an empty HashMap.
       // That's 3 words. Instead, this is only 1 word.
       map: Option<Box<AnyMap>>,
   }
   ```


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org