Create a new file item. # Arguments `path` - Path relative to repository root `inode` - File's stable identifier `position` - Root position in the graph # Example ```rust use atomic_core::output::repo::TreeItem; use atomic_core::types::{Inode, Position}; let item = TreeItem::file("src/main.rs", Inode::ROOT, Position::ROOT); assert_eq!(item.path, "src/main.rs"); assert!(!item.is_directory); ``
(path: impl Into<String>, inode: Inode, position: Position<NodeId>)
| 509 | /// assert!(!item.is_directory); |
| 510 | /// ``` |
| 511 | pub fn file(path: impl Into<String>, inode: Inode, position: Position<NodeId>) -> Self { |
| 512 | let path = path.into(); |
| 513 | let depth = TreeCollectOptions::path_depth(&path); |
| 514 | Self { |
| 515 | path, |
| 516 | inode, |
| 517 | position, |
| 518 | is_directory: false, |
| 519 | metadata: FileMetadata::file(), |
| 520 | depth, |
| 521 | } |
| 522 | } |
| 523 | |
| 524 | /// Create a new directory item. |
| 525 | /// |
nothing calls this directly
no outgoing calls
no test coverage detected