toasty_core/stmt/
source_table_id.rs

1/// An index into a [`SourceTable`](super::SourceTable)'s `tables` vector.
2///
3/// Used by [`TableFactor`](super::TableFactor) and [`Join`](super::Join) to
4/// reference a specific table without duplicating the full [`TableRef`](super::TableRef).
5///
6/// # Examples
7///
8/// ```ignore
9/// use toasty_core::stmt::SourceTableId;
10///
11/// let id = SourceTableId(0);
12/// assert_eq!(id.0, 0);
13/// ```
14#[derive(Debug, Clone, Copy, PartialEq, Eq)]
15pub struct SourceTableId(pub usize);
16
17impl From<usize> for SourceTableId {
18    fn from(value: usize) -> Self {
19        Self(value)
20    }
21}