Skip to main content

LabelExpr

Enum LabelExpr 

Source
pub enum LabelExpr {
    Label(SmallName),
    Wildcard,
    Dynamic {
        expr: Box<Expr>,
        quantifier: DynamicLabelQuantifier,
    },
    Not(Box<LabelExpr>),
    And(Vec<LabelExpr>),
    Or(Vec<LabelExpr>),
}

Variants§

§

Label(SmallName)

§

Wildcard

§

Dynamic

Fields

§expr: Box<Expr>
§

Not(Box<LabelExpr>)

§

And(Vec<LabelExpr>)

§

Or(Vec<LabelExpr>)

Implementations§

Source§

impl LabelExpr

Source

pub fn is_static_conjunction(&self) -> bool

Static conjunction: a single label or an And-chain of static labels.

Source

pub fn is_static_disjunction(&self) -> bool

Static disjunction: a single label or an Or-chain of static labels.

Source

pub fn static_disjunction_arms(&self) -> Option<DisjunctionArms<'_>>

The per-arm borrowed views of a disjunction-bearing label expression (LABS-1083): the two shapes the planner’s disjunction fold and the parsed (p:A|B) produce. Or([A, B]) answers one view — empty base, disjuncts [A, B] — each disjunct its own arm; And([C, Or([A, B])]) (the pattern’s own conjunction carried beside the folded Or) answers base [C], disjuncts [A, B] — every arm the shared conjunction plus one disjunct. Every arm is a static conjunction, and the union of the arms’ conjunctions is equivalent to the expression, so a consumer that serves each arm’s conjunction and unions the answers (deduplicated) serves the expression. None for everything else: no disjunction (a plain label or conjunction), a nested Or, an And of several Ors (a DNF no producer builds), an empty Or, or any wildcard, dynamic, or negated leaf. The arm-extraction twin of is_static_conjunction: conjunction consumers read a node’s retained labels, disjunction consumers read this.

The views borrow: arm i is DisjunctionArms::arms — the base’s names plus one disjunct, iterated over the expression’s own names — never a per-disjunct Vec clone of the shared conjunction (the O(n·k) copies an owned per-arm answer would pay for an O(n+k) expression).

Trait Implementations§

Source§

impl Clone for LabelExpr

Source§

fn clone(&self) -> Self

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 LabelExpr

Source§

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

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

impl PartialEq for LabelExpr

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for LabelExpr

Auto Trait Implementations§

§

impl Forget for LabelExpr

§

impl Freeze for LabelExpr
where *const ArcInner<str> is !null: Freeze, PhantomData<ArcInner<str>>: Freeze, *const Expr is !null: Freeze, PhantomData<Expr>: Freeze, *const LabelExpr is !null: Freeze, PhantomData<LabelExpr>: Freeze, *const u8 is !null: Freeze,

§

impl Move for LabelExpr

§

impl RefUnwindSafe for LabelExpr

§

impl Send for LabelExpr
where Arc<str>: Send, BoxRaw<Expr>: Send, BoxRaw<LabelExpr>: Send, RawVecInner: Send,

§

impl Sync for LabelExpr
where Arc<str>: Sync, BoxRaw<Expr>: Sync, BoxRaw<LabelExpr>: Sync, RawVecInner: Sync,

§

impl Unpin for LabelExpr
where Arc<str>: Unpin, Box<Expr>: Unpin, Box<LabelExpr>: Unpin, *const u8 is !null: Unpin,

§

impl UnsafeUnpin for LabelExpr

§

impl UnwindSafe for LabelExpr
where Arc<str>: UnwindSafe, BoxRaw<Expr>: UnwindSafe, BoxRaw<LabelExpr>: UnwindSafe, RawVecInner: UnwindSafe,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.