file_storage/system/r2/folder/list_files.rs
1use crate::system::r2::folder::R2ListFilesOp;
2use crate::system::r2::r2_path::RUNTIME;
3use crate::system::R2Path;
4use crate::Error;
5
6impl<'a> R2Path<'a> {
7 //! List Files
8
9 /// Lists the files in the folder.
10 pub fn list_files(self) -> Result<R2ListFilesOp, Error> {
11 RUNTIME.block_on(self.list_files_async())
12 }
13
14 /// Lists the files in the folder.
15 pub async fn list_files_async(self) -> Result<R2ListFilesOp, Error> {
16 R2ListFilesOp::from_async(self.path.clone().to_folder()?, self).await
17 }
18}