use std::{collections::HashMap, error::Error}; use crate::value::Value; pub trait Format { fn parse( self, uri: Option<&String>, text: &str, ) -> Result, Box>; } impl Format for F where F: Fn(Option<&String>, &str) -> Result, Box> { fn parse( self, uri: Option<&String>, text: &str, ) -> Result, Box> { self(uri, text) } }