forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathempty.rs
More file actions
39 lines (32 loc) · 923 Bytes
/
empty.rs
File metadata and controls
39 lines (32 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use anyhow::{bail, Result};
use turbo_tasks::{Completion, Vc};
use turbopack_core::module::Modules;
use crate::route::{Endpoint, WrittenEndpoint};
#[turbo_tasks::value]
pub struct EmptyEndpoint;
#[turbo_tasks::value_impl]
impl EmptyEndpoint {
#[turbo_tasks::function]
pub fn new() -> Vc<Self> {
EmptyEndpoint.cell()
}
}
#[turbo_tasks::value_impl]
impl Endpoint for EmptyEndpoint {
#[turbo_tasks::function]
fn write_to_disk(self: Vc<Self>) -> Result<Vc<WrittenEndpoint>> {
bail!("Empty endpoint can't be written to disk")
}
#[turbo_tasks::function]
fn server_changed(self: Vc<Self>) -> Vc<Completion> {
Completion::new()
}
#[turbo_tasks::function]
fn client_changed(self: Vc<Self>) -> Vc<Completion> {
Completion::new()
}
#[turbo_tasks::function]
fn root_modules(self: Vc<Self>) -> Vc<Modules> {
Vc::cell(vec![])
}
}