Kinrany opened a new pull request, #3866:
URL: https://github.com/apache/arrow-rs/pull/3866

   This PR implements `object_store::ObjectStore` for trait objects:
   
   ```rust
   impl ObjectStore for Box<dyn ObjectStore> { ... }
   ```
   
   Every method calls the corresponding method of the inner dyn object.
   
   Closes #3865 
   
   # Implementation notes
    
   Ideally this impl would be generated by a macro, but I couldn't find a 
library to do this.
   
   In the future, it might be a good idea to somehow enforce that all default 
methods are implemented. Otherwise if someone implements `ObjectStore` for 
their own type, including a default method not covered by this PR's impl, then 
they will be surprised to find out that `box.foo()` and `(*box).foo()` are 
behaving differently.
   
   I haven't added any tests. This change is fairly generic, so I'm not sure if 
there's a good way to test it. Perhaps there is a property testing library that 
can generate not only different values of a single type but values of different 
types that all implement the same trait.
   
   # User-facing changes
   
   I don't think this will cause any breaking changes. No one but the crate 
itself can add this implementation, and it shouldn't conflict with anything.
   
   The ability to use trait objects for generic variables bound by 
`ObjectStore` is the only change I expect.


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