Young-Flash commented on code in PR #2736:
URL: 
https://github.com/apache/incubator-opendal/pull/2736#discussion_r1281309678


##########
bin/oay/src/services/webdav/webdavfs.rs:
##########
@@ -48,11 +52,27 @@ impl DavFileSystem for WebdavFs {
 
     fn read_dir<'a>(
         &'a self,
-        _path: &'a dav_server::davpath::DavPath,
+        path: &'a dav_server::davpath::DavPath,
         _meta: dav_server::fs::ReadDirMeta,
     ) -> dav_server::fs::FsFuture<dav_server::fs::FsStream<Box<dyn 
dav_server::fs::DavDirEntry>>>
     {
-        todo!()
+        async move {
+            let path = path.as_url_string();
+            let mut lister = self.op.list(path.as_str()).await.unwrap();

Review Comment:
   My idea is:
   ```
   fn read_dir<'a>(
           &'a self,
           path: &'a dav_server::davpath::DavPath,
           _meta: dav_server::fs::ReadDirMeta,
       ) -> dav_server::fs::FsFuture<dav_server::fs::FsStream<Box<dyn 
dav_server::fs::DavDirEntry>>>
   {
     async move {
         let path = path.as_url_string();
         let mut lister = self.op.list(path.as_str()).await.unwrap();
         let entry_stream = DevStream(lister).boxed();
         Ok(entry_stream)
     }
     .boxed()
   }
   
   
   struct DevStream(Lister);
   
   impl Stream for DevStream {
       type Item = Box<dyn DavDirEntry>;
   
       fn poll_next(self: std::pin::Pin<&mut Self>, cx: &mut 
std::task::Context<'_>) -> std::task::Poll<Option<Self::Item>> {
          // use `Lister` poll_next()
       }
   }
   ```
   But the problem is `Item` in `Lister` is `Result<Entry>`, we need to make it 
to a `WebDAVDirEntry`, which need a `op` to construct, but we cannot get `op` 
in `DevStream::poll_next()`. 
   
   Or, can we make a `Metadata` from a `Entry` without `op`? It's required in 
`WebDAVDirEntry::metadata()`. Any suggestion?



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