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

Function get_file_lines_with_options

atomic-core/src/output/crdt.rs:316–328  ·  view source on GitHub ↗

Retrieve all lines for a file by path with options. Like `get_file_lines` but allows controlling which content is included.

(
    txn: &mut T,
    path: &str,
    options: &RetrievalOptions,
)

Source from the content-addressed store, hash-verified

314///
315/// Like `get_file_lines` but allows controlling which content is included.
316pub fn get_file_lines_with_options<T: MutTxnT>(
317 txn: &mut T,
318 path: &str,
319 options: &RetrievalOptions,
320) -> PristineResult<Vec<Line>> {
321 // Look up trunk by path
322 let trunk_id = match txn.get_trunk_by_path(path)? {
323 Some(id) => id,
324 None => return Ok(Vec::new()), // File not found
325 };
326
327 get_file_lines_by_trunk(txn, trunk_id, options)
328}
329
330/// Retrieve all lines for a file by trunk ID.
331pub fn get_file_lines_by_trunk<T: MutTxnT>(

Callers 1

get_file_linesFunction · 0.85

Calls 2

get_file_lines_by_trunkFunction · 0.85
get_trunk_by_pathMethod · 0.45

Tested by

no test coverage detected