1use std::path::PathBuf;
4
5#[derive(Debug, Clone)]
9pub enum ParseInput {
10 Path(PathBuf),
12 Bytes(Vec<u8>),
15}
16
17impl From<PathBuf> for ParseInput {
18 fn from(p: PathBuf) -> Self {
19 ParseInput::Path(p)
20 }
21}
22
23impl From<&std::path::Path> for ParseInput {
24 fn from(p: &std::path::Path) -> Self {
25 ParseInput::Path(p.to_path_buf())
26 }
27}
28
29impl From<String> for ParseInput {
30 fn from(s: String) -> Self {
31 ParseInput::Path(PathBuf::from(s))
32 }
33}
34
35impl From<&str> for ParseInput {
36 fn from(s: &str) -> Self {
37 ParseInput::Path(PathBuf::from(s))
38 }
39}
40
41impl From<Vec<u8>> for ParseInput {
42 fn from(b: Vec<u8>) -> Self {
43 ParseInput::Bytes(b)
44 }
45}