dop 0.2.2

Process, transform and query JSON/YAML/TOML, from the shell.
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::{path::PathEntry, value::*};

pub trait DataFormat {
    fn from_str(&self, s: &str) -> Option<Value>;
    fn to_str(&self, value: &Value, pretty: bool) -> Result<String, ToStrError>;
}

#[derive(Debug)]
pub enum ToStrError {
    #[allow(unused)]
    ParseError(String),
    UnsupportedType((String, Vec<PathEntry>)),
}