mk_lib/schema/
include.rs

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
use serde::Deserialize;

#[derive(Debug, Deserialize)]
pub struct IncludeArgs {
  pub name: String,

  #[serde(default)]
  pub overwrite: bool,
}

#[derive(Debug, Deserialize)]
#[serde(untagged)]
pub enum Include {
  String(String),
  Include(Box<IncludeArgs>),
}

impl Include {
  pub fn capture(&self) -> anyhow::Result<()> {
    match self {
      Include::String(_) => self.capture_root(),
      Include::Include(args) => args.capture_root(),
    }
  }

  fn capture_root(&self) -> anyhow::Result<()> {
    unimplemented!()
  }
}

impl IncludeArgs {
  pub fn capture_root(&self) -> anyhow::Result<()> {
    unimplemented!()
  }
}