pub struct VarPath {
pub segments: Vec<VarSegment>,
}Expand description
Variable reference path: ${VAR}, ${VAR[0]}, ${r[key]}, ${a[b][c]}.
The first segment is always the root variable name (Field); the rest are
bracket subscripts. $? resolves to the previous command’s exit code as an
int (bare only — ${?.field} is rejected). Access is brackets-only: a
dotted ${VAR.field} resolves to a loud error suggesting ${VAR[field]}.
Fields§
§segments: Vec<VarSegment>Implementations§
Source§impl VarPath
impl VarPath
Sourcepub fn simple(name: impl Into<String>) -> Self
pub fn simple(name: impl Into<String>) -> Self
Create a simple variable reference with just a name.
The name is NFC-normalized. café typed as e + U+0301 and café
typed as U+00E9 render identically, so they name one variable; without
this, binding through one spelling and reading through the other
resolves empty and says nothing. Subscript keys are NOT normalized —
a key is data the caller chose, and its bytes are its own.
Trait Implementations§
impl StructuralPartialEq for VarPath
Auto Trait Implementations§
impl Freeze for VarPath
impl RefUnwindSafe for VarPath
impl Send for VarPath
impl Sync for VarPath
impl Unpin for VarPath
impl UnsafeUnpin for VarPath
impl UnwindSafe for VarPath
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
impl<T> OrderedSeq<'_, T> for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
Invokes
WrappingSpan::make_wrapped to wrap an AST node in a span.