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
10pub struct ExecutablePlan<E: EntityKind> {
17 plan: LogicalPlan,
18 _marker: PhantomData<E>,
19}
20
21impl<E: EntityKind> ExecutablePlan<E> {
22 pub(crate) const fn new(plan: LogicalPlan) -> Self {
23 Self {
24 plan,
25 _marker: PhantomData,
26 }
27 }
28
29 #[must_use]
31 pub fn explain(&self) -> ExplainPlan {
32 self.plan.explain()
33 }
34
35 #[must_use]
37 pub fn fingerprint(&self) -> PlanFingerprint {
38 self.plan.fingerprint()
39 }
40
41 #[must_use]
43 pub(crate) const fn mode(&self) -> QueryMode {
44 self.plan.mode
45 }
46
47 pub(crate) const fn access(&self) -> &crate::db::query::plan::AccessPlan {
48 &self.plan.access
49 }
50
51 pub(crate) fn into_inner(self) -> LogicalPlan {
52 self.plan
53 }
54}