pub struct FragmentBuilder;Expand description
Builder for constructing NFA fragments with fragment-local state IDs.
Fragments are created with position-based IDs (state.id == index),
which is the invariant required by all composition operations.
The builder is stateless — each fragment starts with IDs from 0.
Implementations§
Source§impl FragmentBuilder
impl FragmentBuilder
Sourcepub fn single_term(
&self,
term: NfaTerm,
origin: Option<SourceRef>,
) -> NfaFragment
pub fn single_term( &self, term: NfaTerm, origin: Option<SourceRef>, ) -> NfaFragment
Build a single-term fragment
Creates a fragment with one term state (id=0) and one epsilon exit state (id=1). The term state has a consuming transition to the exit.
Sourcepub fn epsilon_fragment(&self) -> NfaFragment
pub fn epsilon_fragment(&self) -> NfaFragment
Build an epsilon-only fragment
Creates a minimal fragment that matches nothing (empty string). Used for optional content and as base case for empty sequences.
Trait Implementations§
Source§impl Debug for FragmentBuilder
impl Debug for FragmentBuilder
Auto Trait Implementations§
impl Freeze for FragmentBuilder
impl RefUnwindSafe for FragmentBuilder
impl Send for FragmentBuilder
impl Sync for FragmentBuilder
impl Unpin for FragmentBuilder
impl UnsafeUnpin for FragmentBuilder
impl UnwindSafe for FragmentBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more