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

Function collect_files

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

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

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

Source from the content-addressed store, hash-verified

879///
880/// A vector of file TreeItems.
881pub fn collect_files<T: TreeTxnT + GraphTxnT>(
882 txn: &T,
883 prefix: &str,
884) -> Result<Vec<TreeItem>, PristineError> {
885 let options = TreeCollectOptions::new()
886 .prefix(prefix)
887 .collect_directories(false);
888
889 let result = collect_tree(txn, "", options)?;
890 Ok(result.items)
891}
892
893/// Collect only directories from the tree.
894///

Callers

nothing calls this directly

Calls 3

collect_treeFunction · 0.85
collect_directoriesMethod · 0.80
prefixMethod · 0.45

Tested by

no test coverage detected