use crate::sql::expression::{expression, Expression}; use crate::sql::idiom::{idiom, Idiom}; use crate::sql::param::{param, Param}; use crate::sql::value::{value, Value}; pub trait Parse { fn parse(val: &str) -> T; } impl Parse for Value { fn parse(val: &str) -> Value { value(val).unwrap().1 } } impl Parse for Param { fn parse(val: &str) -> Param { param(val).unwrap().1 } } impl Parse for Idiom { fn parse(val: &str) -> Idiom { idiom(val).unwrap().1 } } impl Parse for Expression { fn parse(val: &str) -> Expression { expression(val).unwrap().1 } }