@@ -177,6 +177,28 @@ pub trait Access: Send + Sync + Debug + Unpin + 'static {
177177 ) ) )
178178 }
179179
180+ /// Invoke the `undelete` operation on the specified path to restore a soft-deleted object.
181+ ///
182+ /// Require [`Capability::undelete`]
183+ ///
184+ /// # Behavior
185+ ///
186+ /// - `undelete` restores a soft-deleted object to its active state.
187+ /// - `undelete` SHOULD return `Ok(())` if the path is restored successfully.
188+ /// - `undelete` SHOULD return error if the path is not soft-deleted or doesn't exist.
189+ fn undelete (
190+ & self ,
191+ path : & str ,
192+ args : OpUndelete ,
193+ ) -> impl Future < Output = Result < RpUndelete > > + MaybeSend {
194+ let ( _, _) = ( path, args) ;
195+
196+ ready ( Err ( Error :: new (
197+ ErrorKind :: Unsupported ,
198+ "operation is not supported" ,
199+ ) ) )
200+ }
201+
180202 /// Invoke the `list` operation on the specified path.
181203 ///
182204 /// Require [`Capability::list`]
@@ -286,6 +308,12 @@ pub trait AccessDyn: Send + Sync + Debug + Unpin {
286308 ) -> BoxedFuture < ' a , Result < ( RpWrite , oio:: Writer ) > > ;
287309 /// Dyn version of [`Accessor::delete`]
288310 fn delete_dyn ( & self ) -> BoxedFuture < ' _ , Result < ( RpDelete , oio:: Deleter ) > > ;
311+ /// Dyn version of [`Accessor::undelete`]
312+ fn undelete_dyn < ' a > (
313+ & ' a self ,
314+ path : & ' a str ,
315+ args : OpUndelete ,
316+ ) -> BoxedFuture < ' a , Result < RpUndelete > > ;
289317 /// Dyn version of [`Accessor::list`]
290318 fn list_dyn < ' a > (
291319 & ' a self ,
@@ -359,6 +387,14 @@ where
359387 Box :: pin ( self . delete ( ) )
360388 }
361389
390+ fn undelete_dyn < ' a > (
391+ & ' a self ,
392+ path : & ' a str ,
393+ args : OpUndelete ,
394+ ) -> BoxedFuture < ' a , Result < RpUndelete > > {
395+ Box :: pin ( self . undelete ( path, args) )
396+ }
397+
362398 fn list_dyn < ' a > (
363399 & ' a self ,
364400 path : & ' a str ,
@@ -424,6 +460,10 @@ impl Access for dyn AccessDyn {
424460 self . delete_dyn ( ) . await
425461 }
426462
463+ async fn undelete ( & self , path : & str , args : OpUndelete ) -> Result < RpUndelete > {
464+ self . undelete_dyn ( path, args) . await
465+ }
466+
427467 async fn list ( & self , path : & str , args : OpList ) -> Result < ( RpList , Self :: Lister ) > {
428468 self . list_dyn ( path, args) . await
429469 }
@@ -505,6 +545,14 @@ impl<T: Access + ?Sized> Access for Arc<T> {
505545 async move { self . as_ref ( ) . delete ( ) . await }
506546 }
507547
548+ fn undelete (
549+ & self ,
550+ path : & str ,
551+ args : OpUndelete ,
552+ ) -> impl Future < Output = Result < RpUndelete > > + MaybeSend {
553+ async move { self . as_ref ( ) . undelete ( path, args) . await }
554+ }
555+
508556 fn list (
509557 & self ,
510558 path : & str ,
0 commit comments