MCPcopy Create free account
hub / github.com/Recordscript/recordscript / new_read

Method new_read

libs/hbb_common/src/fs.rs:301–325  ·  view source on GitHub ↗
(
        id: i32,
        remote: String,
        path: String,
        file_num: i32,
        show_hidden: bool,
        is_remote: bool,
        enable_overwrite_detection: bool,
    )

Source from the content-addressed store, hash-verified

299 }
300
301 pub fn new_read(
302 id: i32,
303 remote: String,
304 path: String,
305 file_num: i32,
306 show_hidden: bool,
307 is_remote: bool,
308 enable_overwrite_detection: bool,
309 ) -> ResultType<Self> {
310 log::info!("new read {}", path);
311 let files = get_recursive_files(&path, show_hidden)?;
312 let total_size = files.iter().map(|x| x.size).sum();
313 Ok(Self {
314 id,
315 remote,
316 path: get_path(&path),
317 file_num,
318 show_hidden,
319 is_remote,
320 files,
321 total_size,
322 enable_overwrite_detection,
323 ..Default::default()
324 })
325 }
326
327 #[inline]
328 pub fn files(&self) -> &Vec<FileEntry> {

Callers

nothing calls this directly

Calls 3

get_recursive_filesFunction · 0.85
get_pathFunction · 0.85
iterMethod · 0.80

Tested by

no test coverage detected