icydb_core/db/query/plan/
executable.rs1use crate::{
2 db::query::{
3 QueryMode,
4 plan::{ExplainPlan, LogicalPlan, PlanFingerprint},
5 },
6 traits::EntityKind,
7};
8use std::marker::PhantomData;
9
10#[derive(Debug)]
17pub struct ExecutablePlan<E: EntityKind> {
18 plan: LogicalPlan,
19 _marker: PhantomData<E>,
20}
21
22impl<E: EntityKind> ExecutablePlan<E> {
23 pub(crate) const fn new(plan: LogicalPlan) -> Self {
24 Self {
25 plan,
26 _marker: PhantomData,
27 }
28 }
29
30 #[must_use]
32 pub fn explain(&self) -> ExplainPlan {
33 self.plan.explain()
34 }
35
36 #[must_use]
38 pub fn fingerprint(&self) -> PlanFingerprint {
39 self.plan.fingerprint()
40 }
41
42 #[must_use]
44 pub(crate) const fn mode(&self) -> QueryMode {
45 self.plan.mode
46 }
47
48 pub(crate) const fn access(&self) -> &crate::db::query::plan::AccessPlan {
49 &self.plan.access
50 }
51
52 pub(crate) fn into_inner(self) -> LogicalPlan {
53 self.plan
54 }
55}