pub enum PathSegment {
Field(Box<str>),
Index(usize),
FieldOrIndex(Box<str>, usize),
}Expand description
A pre-parsed path segment for compiled variable access.
Variants§
Field(Box<str>)
Object field access by key
Index(usize)
Array element access by index
FieldOrIndex(Box<str>, usize)
Try as object key first, then as array index (for segments that could be either). Pre-parses the index at compile time to avoid runtime parsing.
Trait Implementations§
Source§impl Clone for PathSegment
impl Clone for PathSegment
Source§fn clone(&self) -> PathSegment
fn clone(&self) -> PathSegment
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PathSegment
impl RefUnwindSafe for PathSegment
impl Send for PathSegment
impl Sync for PathSegment
impl Unpin for PathSegment
impl UnwindSafe for PathSegment
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