Xuanwo commented on code in PR #2736:
URL:
https://github.com/apache/incubator-opendal/pull/2736#discussion_r1280636896
##########
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:
> `FsStream` is a type, not a trait thinking
It's an aliase to:
```rust
pub type FsStream<T> = Pin<Box<dyn Stream<Item = T> + Send>>;
```
We just need to return a `Pin<Box<dyn Stream<Item = T>>>`
##########
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:
> `FsStream` is a type, not a trait thinking
It's an aliase to stream:
```rust
pub type FsStream<T> = Pin<Box<dyn Stream<Item = T> + Send>>;
```
We just need to return a `Pin<Box<dyn Stream<Item = T>>>`
--
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]