async fn list<'a>(
        &'a self,
        prefix: Option<&'a str>,
    ) -> InternalResult<impl Stream<Item = InternalResult<Vec<String>>> + 'a> {
        let bucket_name = self.bucket_name.clone();
        let prefix = prefix.map(|p| p.to_string());

        let objects = tokio::task::spawn_blocking(move || match prefix {
            Some(prefix) => cloud_storage::Object::list_prefix(&bucket_name, &prefix),
            None => cloud_storage::Object::list(&bucket_name),
        })
        .await
        .context(UnableToListDataFromGcs {
            bucket: &self.bucket_name,
        })?
        .context(UnableToListDataFromGcs2 {
            bucket: &self.bucket_name,
        })?;

        Ok(futures::stream::once(async move {
            Ok(objects.into_iter().map(|o| o.name).collect())
        }))
    }
/// 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 bucket_name = self.bucket_name.clone();
        let prefix = prefix.map(|p| p.to_string());
        let objects = tokio::task::spawn_blocking(move || match prefix {
            Some(prefix) => cloud_storage::Object::list_prefix(&bucket_name, &prefix),
            None => cloud_storage::Object::list(&bucket_name),
        })
        .await
        .context(UnableToListDataFromGcs {
            bucket: &self.bucket_name,
        })?
        .context(UnableToListDataFromGcs2 {
            bucket: &self.bucket_name,
        })?;
        Ok(futures::stream::once(async move {
            Ok(objects.into_iter().map(|o| o.name).collect())
        }))
    }
async fn list < ' a > ( & ' a self , prefix : Option < & ' a str > , ) -> InternalResult < impl Stream < Item = InternalResult < Vec < String > > > + ' a > { let bucket_name = self . bucket_name . clone ( ) ; let prefix = prefix . map ( | p | p . to_string ( ) ) ; let objects = tokio :: task :: spawn_blocking ( move | | match prefix { Some ( prefix ) => cloud_storage :: Object :: list_prefix ( & bucket_name , & prefix ) , None => cloud_storage :: Object :: list ( & bucket_name ) , } ) . await . context ( UnableToListDataFromGcs { bucket : & self . bucket_name , } ) ? . context ( UnableToListDataFromGcs2 { bucket : & self . bucket_name , } ) ? ; Ok ( futures :: stream :: once ( async move { Ok ( objects . into_iter ( ) . map ( | o | o . name ) . collect ( ) ) } ) ) }
List all the objects with the given prefix.
List all the objects with the given prefix .
&'a self
prefix
Option<&'a str>