turbopack_core/
server_fs.rs1use anyhow::{Result, bail};
2use turbo_tasks::{ValueToString, Vc};
3use turbo_tasks_fs::{
4 FileContent, FileMeta, FileSystem, FileSystemPath, LinkContent, RawDirectoryContent,
5};
6
7#[turbo_tasks::value]
8#[derive(ValueToString)]
9#[value_to_string("root-of-the-server")]
10pub struct ServerFileSystem {}
11
12#[turbo_tasks::value_impl]
13impl ServerFileSystem {
14 #[turbo_tasks::function]
15 pub fn new() -> Vc<Self> {
16 Self::cell(ServerFileSystem {})
17 }
18}
19
20#[turbo_tasks::value_impl]
21impl FileSystem for ServerFileSystem {
22 #[turbo_tasks::function]
23 fn read(&self, _fs_path: FileSystemPath) -> Result<Vc<FileContent>> {
24 bail!("Reading is not possible from the marker filesystem for the server")
25 }
26
27 #[turbo_tasks::function]
28 fn read_link(&self, _fs_path: FileSystemPath) -> Result<Vc<LinkContent>> {
29 bail!("Reading is not possible from the marker filesystem for the server")
30 }
31
32 #[turbo_tasks::function]
33 fn raw_read_dir(&self, _fs_path: FileSystemPath) -> Result<Vc<RawDirectoryContent>> {
34 bail!("Reading is not possible from the marker filesystem for the server")
35 }
36
37 #[turbo_tasks::function]
38 fn write(&self, _fs_path: FileSystemPath, _content: Vc<FileContent>) -> Result<Vc<()>> {
39 bail!("Writing is not possible to the marker filesystem for the server")
40 }
41
42 #[turbo_tasks::function]
43 fn write_link(&self, _fs_path: FileSystemPath, _target: Vc<LinkContent>) -> Result<Vc<()>> {
44 bail!("Writing is not possible to the marker filesystem for the server")
45 }
46
47 #[turbo_tasks::function]
48 fn metadata(&self, _fs_path: FileSystemPath) -> Result<Vc<FileMeta>> {
49 bail!("Reading is not possible from the marker filesystem for the server")
50 }
51}