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

Function collect_files

atomic-core/src/output/repo/tree.rs:871–881  ·  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

869///
870/// A vector of file TreeItems.
871pub fn collect_files<T: TreeTxnT + GraphTxnT>(
872 txn: &T,
873 prefix: &str,
874) -> Result<Vec<TreeItem>, PristineError> {
875 let options = TreeCollectOptions::new()
876 .prefix(prefix)
877 .collect_directories(false);
878
879 let result = collect_tree(txn, "", options)?;
880 Ok(result.items)
881}
882
883/// Collect only directories from the tree.
884///

Callers

nothing calls this directly

Calls 3

collect_treeFunction · 0.85
collect_directoriesMethod · 0.80
prefixMethod · 0.45

Tested by

no test coverage detected