MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / collect_directories

Function collect_directories

atomic-core/src/output/repo/tree.rs:895–905  ·  view source on GitHub ↗

Collect only directories from the tree. Convenience function that collects only directories, not files. # Arguments `txn` - Transaction providing tree access `prefix` - Optional prefix filter # Returns A vector of directory TreeItems.

(
    txn: &T,
    prefix: &str,
)

Source from the content-addressed store, hash-verified

893///
894/// A vector of directory TreeItems.
895pub fn collect_directories<T: TreeTxnT + GraphTxnT>(
896 txn: &T,
897 prefix: &str,
898) -> Result<Vec<TreeItem>, PristineError> {
899 let options = TreeCollectOptions::new()
900 .prefix(prefix)
901 .collect_files(false);
902
903 let result = collect_tree(txn, "", options)?;
904 Ok(result.items)
905}
906
907/// Build a tree structure from flat paths.
908///

Callers

nothing calls this directly

Calls 3

collect_treeFunction · 0.85
collect_filesMethod · 0.80
prefixMethod · 0.45

Tested by

no test coverage detected