(entry: &pb::TreeEntry)
| 103 | } |
| 104 | |
| 105 | pub fn tree_entry_kind(entry: &pb::TreeEntry) -> Result<ViewEntryKind, String> { |
| 106 | match pb::TreeEntryKind::try_from(entry.kind) { |
| 107 | Ok(pb::TreeEntryKind::File) => Ok(ViewEntryKind::File), |
| 108 | Ok(pb::TreeEntryKind::Directory) => Ok(ViewEntryKind::Directory), |
| 109 | Ok(pb::TreeEntryKind::Symlink) => Ok(ViewEntryKind::Symlink), |
| 110 | _ => Err(format!("entry {:?} has no kind", entry.path)), |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | /// A kernel skeleton on the wire, with `snapshot` the view's and `live` its |
| 115 | /// rendered tree (inode → path) when the caller has it. |
no outgoing calls