CompiledQuery

Struct CompiledQuery 

Source
pub struct CompiledQuery { /* private fields */ }
Expand description

A compiled query ready for execution.

Contains a single contiguous buffer with all segments, plus offset indices for O(1) access to each segment.

Implementations§

Source§

impl CompiledQuery

Source

pub fn new( buffer: CompiledQueryBuffer, successors_offset: u32, effects_offset: u32, negated_fields_offset: u32, string_refs_offset: u32, string_bytes_offset: u32, type_defs_offset: u32, type_members_offset: u32, entrypoints_offset: u32, trivia_kinds_offset: u32, transition_count: u32, successor_count: u32, effect_count: u32, negated_field_count: u16, string_ref_count: u16, type_def_count: u16, type_member_count: u16, entrypoint_count: u16, trivia_kind_count: u16, ) -> Self

Creates a new compiled query from pre-built components.

This is typically called by the emitter after layout computation.

Source

pub fn transitions(&self) -> &[Transition]

Returns the transitions segment.

Source

pub fn successors(&self) -> &[TransitionId]

Returns the successors segment.

Source

pub fn effects(&self) -> &[EffectOp]

Returns the effects segment.

Source

pub fn negated_fields(&self) -> &[NodeFieldId]

Returns the negated fields segment.

Source

pub fn string_refs(&self) -> &[StringRef]

Returns the string refs segment.

Source

pub fn string_bytes(&self) -> &[u8]

Returns the raw string bytes.

Source

pub fn type_defs(&self) -> &[TypeDef]

Returns the type definitions segment.

Source

pub fn type_members(&self) -> &[TypeMember]

Returns the type members segment.

Source

pub fn entrypoints(&self) -> &[Entrypoint]

Returns the entrypoints segment.

Source

pub fn trivia_kinds(&self) -> &[NodeTypeId]

Returns the trivia kinds segment (node types to skip).

Source

pub fn transition(&self, id: TransitionId) -> &Transition

Returns a transition by ID.

Source

pub fn transition_view(&self, id: TransitionId) -> TransitionView<'_>

Returns a view of a transition with resolved slices.

Source

pub fn string(&self, id: StringId) -> &str

Resolves a string ID to its UTF-8 content.

Source

pub fn resolve_effects(&self, slice: Slice<EffectOp>) -> &[EffectOp]

Resolves a slice of effects.

Source

pub fn resolve_negated_fields( &self, slice: Slice<NodeFieldId>, ) -> &[NodeFieldId]

Resolves a slice of negated fields.

Source

pub fn resolve_type_members(&self, slice: Slice<TypeMember>) -> &[TypeMember]

Resolves a slice of type members.

Source

pub fn resolve_successors_by_id(&self, id: TransitionId) -> &[TransitionId]

Resolves successors for a transition by ID, handling both inline and spilled cases.

Source

pub fn transition_count(&self) -> u32

Returns the number of transitions.

Source

pub fn entrypoint_count(&self) -> u16

Returns the number of entrypoints.

Source

pub fn buffer(&self) -> &CompiledQueryBuffer

Returns the raw buffer for serialization.

Source

pub fn offsets(&self) -> CompiledQueryOffsets

Returns offset metadata for serialization.

Source

pub fn dump(&self) -> String

Dumps the compiled query in human-readable format for debugging.

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.