nu_protocol/pipeline/
metadata.rs1use std::path::PathBuf;
2
3use serde::{Deserialize, Serialize};
4
5#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
7pub struct PipelineMetadata {
8 pub data_source: DataSource,
9 pub content_type: Option<String>,
10}
11
12impl PipelineMetadata {
13 pub fn with_data_source(self, data_source: DataSource) -> Self {
14 Self {
15 data_source,
16 ..self
17 }
18 }
19
20 pub fn with_content_type(self, content_type: Option<String>) -> Self {
21 Self {
22 content_type,
23 ..self
24 }
25 }
26}
27
28#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
33pub enum DataSource {
34 Ls,
35 HtmlThemes,
36 FilePath(PathBuf),
37 #[default]
38 None,
39}