toasty_core/stmt/
include.rs1use super::{Node, Path, Query, Visit, VisitMut};
2
3#[derive(Debug, Clone, PartialEq)]
5pub struct Include {
6 pub path: Path,
8
9 pub query: Option<Query>,
11}
12
13impl Include {
14 pub fn new(path: Path) -> Self {
16 Self { path, query: None }
17 }
18
19 pub fn with_query(path: Path, query: Query) -> Self {
21 Self {
22 path,
23 query: Some(query),
24 }
25 }
26}
27
28impl From<Path> for Include {
29 fn from(path: Path) -> Self {
30 Self::new(path)
31 }
32}
33
34impl Node for Include {
35 fn visit<V: Visit>(&self, mut visit: V) {
36 visit.visit_include(self);
37 }
38
39 fn visit_mut<V: VisitMut>(&mut self, mut visit: V) {
40 visit.visit_include_mut(self);
41 }
42}