Skip to main content

PlanStatement

Struct PlanStatement 

Source
pub struct PlanStatement {
    pub ops: Vec<ReadOp>,
    pub write_ops: Vec<WriteOp>,
    pub var_map: IndexMap<VarId, VarId>,
}
Expand description

The result of lowering a single HIR Statement to a logical plan.

ops is the operator arena: each entry is a ReadOp and may reference earlier entries via OpId. The last entry is the root. If the statement has no read phase (e.g. bare CREATE), ops is empty and the root is implicit (one write pass over an empty row).

write_ops are applied in order after every row produced by the read phase. For a pure read query they are empty.

var_map maps plan-scoped VarIds back to HIR HirVarIds for diagnostic purposes (spec §12.3).

Fields§

§ops: Vec<ReadOp>

Ordered flat arena of read operators. References use dense OpId.

§write_ops: Vec<WriteOp>

Write operators applied after each read-phase row.

§var_map: IndexMap<VarId, VarId>

Mapping from plan VarId → HIR HirVarId. Insertion-ordered for determinism (spec §17.14).

Implementations§

Source§

impl PlanStatement

Source

pub fn empty() -> Self

Construct an empty PlanStatement — no read or write operators and an empty var_map. Useful as a fallback when downstream callers need a plan shape for a malformed query (cy-wlr).

Trait Implementations§

Source§

impl Clone for PlanStatement

Source§

fn clone(&self) -> PlanStatement

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PlanStatement

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PlanStatement

Source§

fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for PlanStatement

Source§

fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,