(
file: &ObservedFile,
content_id: Hash,
mode: u16,
kind: InodeKind,
racy_after: FileIndexTimestamp,
conversion_policy: Hash,
)
| 773 | } |
| 774 | |
| 775 | fn observed_index_row( |
| 776 | file: &ObservedFile, |
| 777 | content_id: Hash, |
| 778 | mode: u16, |
| 779 | kind: InodeKind, |
| 780 | racy_after: FileIndexTimestamp, |
| 781 | conversion_policy: Hash, |
| 782 | ) -> Result<FileIndexV2Entry, ChangeSourceError> { |
| 783 | FileIndexV2Entry::complete( |
| 784 | file.device.ok_or_else(|| ChangeSourceError::InvalidIndex { |
| 785 | path: file.native_path.display().to_string(), |
| 786 | message: "device identity unavailable".into(), |
| 787 | })?, |
| 788 | file.inode.ok_or_else(|| ChangeSourceError::InvalidIndex { |
| 789 | path: file.native_path.display().to_string(), |
| 790 | message: "inode identity unavailable".into(), |
| 791 | })?, |
| 792 | file.mtime.ok_or_else(|| ChangeSourceError::InvalidIndex { |
| 793 | path: file.native_path.display().to_string(), |
| 794 | message: "mtime unavailable".into(), |
| 795 | })?, |
| 796 | file.ctime.ok_or_else(|| ChangeSourceError::InvalidIndex { |
| 797 | path: file.native_path.display().to_string(), |
| 798 | message: "ctime unavailable".into(), |
| 799 | })?, |
| 800 | file.size, |
| 801 | content_id, |
| 802 | mode, |
| 803 | kind, |
| 804 | racy_after, |
| 805 | conversion_policy, |
| 806 | ) |
| 807 | .map_err(|error| ChangeSourceError::InvalidIndex { |
| 808 | path: file.native_path.display().to_string(), |
| 809 | message: error.to_string(), |
| 810 | }) |
| 811 | } |
| 812 | |
| 813 | #[cfg(unix)] |
| 814 | fn observe_metadata(native_path: std::path::PathBuf, metadata: &fs::Metadata) -> ObservedFile { |
no test coverage detected