Attempts to open a file in read-only mode. This is a proxy to [`tokio::fs::File::open`].
(&self, path: impl AsRef<Path>)
| 153 | /// |
| 154 | /// This is a proxy to [`tokio::fs::File::open`]. |
| 155 | pub async fn open(&self, path: impl AsRef<Path>) -> io::Result<fs::File> { |
| 156 | match self { |
| 157 | Self::Real => fs::File::open(path).await, |
| 158 | Self::Chroot(root) => fs::File::open(append(root.path(), path)).await, |
| 159 | Self::Fake(_) => Err(io::Error::other("unimplemented")), |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | pub async fn read(&self, path: impl AsRef<Path>) -> io::Result<Vec<u8>> { |
| 164 | match self { |
no test coverage detected