JanKaul commented on issue #172:
URL: https://github.com/apache/iceberg-rust/issues/172#issuecomment-2473732060

   To increase the ergonomics one could introduce an additional trait that 
would be implemented on top of `ObjectStore`, like so:
   ```rust
   #[async_trait]
   pub trait IcebergStore {
       async fn get_metadata(&self, location: Path) -> Result<TableMetadata, 
Error>;
   }
   
   #[async_trait]
   impl<T: ObjectStore> IcebergStore for T {
       async fn get_metadata(&self, location: Path) -> Result<TableMetadata, 
Error> {
           let bytes = self.get(&location).await?.bytes().await?;
           Ok(serde_json::from_slice(&bytes)?)
       }
   }
   
   ```
   This provides better ergonomics while maintaining all the flexibility that 
you get with `ObjectStore`.


-- 
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: issues-unsubscr...@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to