pub(crate) async fn list_entries(
        &self,
        query: Query,
        parent_inode: u64,
    ) -> Result<Vec<(u64, FileType, String)>> {
        // TODO: Actually use paging here.
        let results = self.client.query(query.with_size(5000)).await?;

        // All directories have "." and ".."
        let mut entries = vec![
            (parent_inode, FileType::Directory, ".".to_string()),
            (parent_inode, FileType::Directory, "..".to_string()),
        ];
        entries.reserve(results.count);

        for hit in results.hits.into_iter() {
            let inode = self.get_inode(&hit.id).await;
            let file_type = if hit.meta.blob_type == menmos_client::Type::Directory {
                FileType::Directory
            } else {
                FileType::RegularFile
            };
            let blob_id = hit.id;
            let name = hit.meta.name.clone();
            self.name_to_blobid
                .insert((parent_inode, name.clone()), blob_id)
                .await;
            entries.push((inode, file_type, name))
        }

        Ok(entries)
    }
/// Lists entries for a physical (backed by a blob on the menmos cluster) directory.
Lists entries for a physical (backed by a blob on the menmos cluster) directory.
Lists entries for a physical ( backed by a blob on the menmos cluster ) directory .
pub(crate) async fn list_entries(
        &self,
        query: Query,
        parent_inode: u64,
    ) -> Result<Vec<(u64, FileType, String)>> {
        // TODO: Actually use paging here.
        let results = self.client.query(query.with_size(5000)).await?;
        // All directories have "." and ".."
        let mut entries = vec![
            (parent_inode, FileType::Directory, ".".to_string()),
            (parent_inode, FileType::Directory, "..".to_string()),
        ];
        entries.reserve(results.count);
        for hit in results.hits.into_iter() {
            let inode = self.get_inode(&hit.id).await;
            let file_type = if hit.meta.blob_type == menmos_client::Type::Directory {
                FileType::Directory
            } else {
                FileType::RegularFile
            };
            let blob_id = hit.id;
            let name = hit.meta.name.clone();
            self.name_to_blobid
                .insert((parent_inode, name.clone()), blob_id)
                .await;
            entries.push((inode, file_type, name))
        }
        Ok(entries)
    }
pub ( crate ) async fn list_entries ( & self , query : Query , parent_inode : u64 , ) -> Result < Vec < ( u64 , FileType , String ) > > { // TODO: Actually use paging here. let results = self . client . query ( query . with_size ( 5000 ) ) . await ? ; // All directories have "." and ".." let mut entries = vec ! [ ( parent_inode FileType Directory " " to_string ( ) ) ( parent_inode FileType Directory " " to_string ( ) ) ] ; entries . reserve ( results . count ) ; for hit in results . hits . into_iter ( ) { let inode = self . get_inode ( & hit . id ) . await ; let file_type = if hit . meta . blob_type == menmos_client :: Type :: Directory { FileType :: Directory } else { FileType :: RegularFile } ; let blob_id = hit . id ; let name = hit . meta . name . clone ( ) ; self . name_to_blobid . insert ( ( parent_inode , name . clone ( ) ) , blob_id ) . await ; entries . push ( ( inode , file_type , name ) ) } Ok ( entries ) }
Lists entries for a physical (backed by a blob on the menmos cluster) directory.
Lists entries for a physical ( backed by a blob on the menmos cluster ) directory .
&self
query
Query
parent_inode
u64
&self
query
Query
parent_inode
u64