Skip to main content

toql_core/
query_path.rs

1//! Trait to associate a field type provider with a struct.
2
3use crate::query::selection::Selection;
4use crate::query::wildcard::Wildcard;
5
6/// Used by code produced from Toql derive.
7pub trait QueryPath
8where
9    Self: std::marker::Sized,
10{
11    fn wildcard(self) -> Wildcard {
12        Wildcard::from(self.into_path())
13    }
14    fn selection(self, name: &str) -> Selection {
15        Selection::from(format!("{}{}", self.into_path(), name))
16    }
17
18    fn into_path(self) -> String;
19}