Download next.js/crates/next-api/src/empty.rs from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/crates/next-api/src/empty.rs
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/crates/next-api/src/empty.rs
-
curl -L -o empty.rs https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/crates/next-api/src/empty.rs
1.06 kB
| use anyhow::{Result, bail}; | |
| use turbo_tasks::{Completion, Vc}; | |
| use turbopack_core::module_graph::GraphEntries; | |
| use crate::route::{Endpoint, EndpointOutput, ModuleGraphs}; | |
| pub struct EmptyEndpoint; | |
| impl EmptyEndpoint { | |
| pub fn new() -> Vc<Self> { | |
| EmptyEndpoint.cell() | |
| } | |
| } | |
| impl Endpoint for EmptyEndpoint { | |
| fn output(self: Vc<Self>) -> Result<Vc<EndpointOutput>> { | |
| bail!("Empty endpoint can't have output") | |
| } | |
| fn server_changed(self: Vc<Self>) -> Vc<Completion> { | |
| Completion::new() | |
| } | |
| fn client_changed(self: Vc<Self>) -> Vc<Completion> { | |
| Completion::new() | |
| } | |
| fn entries(self: Vc<Self>) -> Vc<GraphEntries> { | |
| GraphEntries::empty() | |
| } | |
| fn module_graphs(self: Vc<Self>) -> Vc<ModuleGraphs> { | |
| Vc::cell(vec![]) | |
| } | |
| } | |