@@ -834,12 +834,6 @@ pub trait ObjectStore: std::fmt::Display + Send + Sync + Debug + 'static {
834834 . await
835835 }
836836
837- /// Return the metadata for the specified location
838- async fn head ( & self , location : & Path ) -> Result < ObjectMeta > {
839- let options = GetOptions :: new ( ) . with_head ( true ) ;
840- Ok ( self . get_opts ( location, options) . await ?. meta )
841- }
842-
843837 /// Delete the object at the specified location.
844838 async fn delete ( & self , location : & Path ) -> Result < ( ) > ;
845839
@@ -1106,10 +1100,6 @@ macro_rules! as_ref_impl {
11061100 self . as_ref( ) . get_ranges( location, ranges) . await
11071101 }
11081102
1109- async fn head( & self , location: & Path ) -> Result <ObjectMeta > {
1110- self . as_ref( ) . head( location) . await
1111- }
1112-
11131103 async fn delete( & self , location: & Path ) -> Result <( ) > {
11141104 self . as_ref( ) . delete( location) . await
11151105 }
@@ -1250,6 +1240,9 @@ pub trait ObjectStoreExt: ObjectStore {
12501240 /// }
12511241 /// ```
12521242 fn get_range ( & self , location : & Path , range : Range < u64 > ) -> impl Future < Output = Result < Bytes > > ;
1243+
1244+ /// Return the metadata for the specified location
1245+ fn head ( & self , location : & Path ) -> impl Future < Output = Result < ObjectMeta > > ;
12531246}
12541247
12551248impl < T > ObjectStoreExt for T
@@ -1274,6 +1267,11 @@ where
12741267 let options = GetOptions :: new ( ) . with_range ( Some ( range) ) ;
12751268 self . get_opts ( location, options) . await ?. bytes ( ) . await
12761269 }
1270+
1271+ async fn head ( & self , location : & Path ) -> Result < ObjectMeta > {
1272+ let options = GetOptions :: new ( ) . with_head ( true ) ;
1273+ Ok ( self . get_opts ( location, options) . await ?. meta )
1274+ }
12771275}
12781276
12791277/// Result of a list call that includes objects, prefixes (directories) and a
0 commit comments