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