imdl 0.1.16

📦 A 40' shipping container for the internet
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::common::*;

pub(crate) struct Input {
  pub(crate) source: InputTarget,
  pub(crate) data: Vec<u8>,
}

impl Input {
  #[cfg(test)]
  pub(crate) fn from_path(path: &Path) -> Result<Input> {
    let data = fs::read(path).context(error::Filesystem { path })?;
    Ok(Input {
      source: InputTarget::Path(path.to_owned()),
      data,
    })
  }
}