async fn list<'a>(
        &'a self,
        prefix: Option<&'a str>,
    ) -> InternalResult<impl Stream<Item = InternalResult<Vec<String>>> + 'a> {
        let dirs = fs::read_dir(&self.root)
            .await
            .context(UnableToListDirectory { path: &self.root })?;

        let s = dirs
            .context(UnableToProcessEntry)
            .and_then(|entry| {
                let name = entry
                    .file_name()
                    .into_string()
                    .ok()
                    .context(UnableToGetFileName);
                async move { name }
            })
            .try_filter(move |name| {
                let matches = prefix.map_or(true, |p| name.starts_with(p));
                async move { matches }
            })
            .map_ok(|name| vec![name]);
        Ok(s)
    }
/// List all the objects with the given prefix.
List all the objects with the given prefix.
List all the objects with the given prefix .
async fn list<'a>(
        &'a self,
        prefix: Option<&'a str>,
    ) -> InternalResult<impl Stream<Item = InternalResult<Vec<String>>> + 'a> {
        let dirs = fs::read_dir(&self.root)
            .await
            .context(UnableToListDirectory { path: &self.root })?;
        let s = dirs
            .context(UnableToProcessEntry)
            .and_then(|entry| {
                let name = entry
                    .file_name()
                    .into_string()
                    .ok()
                    .context(UnableToGetFileName);
                async move { name }
            })
            .try_filter(move |name| {
                let matches = prefix.map_or(true, |p| name.starts_with(p));
                async move { matches }
            })
            .map_ok(|name| vec![name]);
        Ok(s)
    }
async fn list < ' a > ( & ' a self , prefix : Option < & ' a str > , ) -> InternalResult < impl Stream < Item = InternalResult < Vec < String > > > + ' a > { let dirs = fs :: read_dir ( & self . root ) . await . context ( UnableToListDirectory { path : & self . root } ) ? ; let s = dirs . context ( UnableToProcessEntry ) . and_then ( | entry | { let name = entry . file_name ( ) . into_string ( ) . ok ( ) . context ( UnableToGetFileName ) ; async move { name } } ) . try_filter ( move | name | { let matches = prefix . map_or ( true , | p | name . starts_with ( p ) ) ; async move { matches } } ) . map_ok ( | name | vec ! [ name ] ) ; Ok ( s ) }
List all the objects with the given prefix.
List all the objects with the given prefix .
&'a self
prefix
Option<&'a str>