1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
use crate::Query; use ql2::term::TermType; use serde_json::Value; pub trait Arg { fn into_query(self) -> Query; } impl Arg for Query { fn into_query(self) -> Query { Self::new(TermType::Bracket).with_arg(self) } } impl<T> Arg for T where T: Into<Value>, { fn into_query(self) -> Query { Query::from_json(self).into_query() } }