toasty_core/stmt/
association.rs

1use super::{Path, Query};
2
3/// A reference to an association traversal from a source query.
4///
5/// Used in [`SourceModel::via`](super::SourceModel) to indicate that a model
6/// is reached by following a relation path from another query's results.
7///
8/// # Examples
9///
10/// ```ignore
11/// use toasty_core::stmt::{Association, Query, Path};
12///
13/// let assoc = Association {
14///     source: Box::new(Query::unit()),
15///     path: Path::from(vec![0]),
16/// };
17/// ```
18#[derive(Debug, Clone, PartialEq)]
19pub struct Association {
20    /// The source query whose results are the starting point.
21    pub source: Box<Query>,
22
23    /// The field path from the source model to the target model.
24    pub path: Path,
25}