1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
use crate::Query; use ql2::term::TermType; use std::ops::Sub; pub trait Arg { fn into_query(self) -> Query; } impl Arg for Query { fn into_query(self) -> Query { Self::new(TermType::Sub).with_arg(self) } } impl<T> Sub<T> for Query where T: Arg, { type Output = Self; fn sub(self, arg: T) -> Self { arg.into_query().with_parent(self) } }