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

Method with_details

atomic-core/src/record/item.rs:616–636  ·  view source on GitHub ↗

Create a record item with full details. # Arguments `path` - The file path `inode` - The file's inode `parent_inode` - The parent directory's inode `parent_position` - The parent's graph position `metadata` - File metadata

(
        path: PathBuf,
        inode: Inode,
        parent_inode: Inode,
        parent_position: Position<NodeId>,
        metadata: FileMetadata,
    )

Source from the content-addressed store, hash-verified

614 /// * `parent_position` - The parent's graph position
615 /// * `metadata` - File metadata
616 pub fn with_details(
617 path: PathBuf,
618 inode: Inode,
619 parent_inode: Inode,
620 parent_position: Position<NodeId>,
621 metadata: FileMetadata,
622 ) -> Self {
623 let basename = path
624 .file_name()
625 .map(|s| s.to_string_lossy().to_string())
626 .unwrap_or_default();
627
628 Self {
629 path,
630 basename,
631 inode,
632 parent_inode,
633 parent_position,
634 metadata,
635 }
636 }
637
638 /// Get the file path.
639 pub fn path(&self) -> &Path {

Callers

nothing calls this directly

Calls 1

file_nameMethod · 0.80

Tested by

no test coverage detected