pub enum IdiomPart {
Start(Box<Spanned<Expr>>),
Field(String),
Index(Box<Spanned<Expr>>),
All,
Last,
Graph {
dir: Spanned<GraphDir>,
step: GraphStep,
},
Destructure(Vec<Spanned<Idiom>>),
Where(Box<Spanned<Expr>>),
Method {
name: Spanned<String>,
args: Vec<Spanned<Expr>>,
},
Recurse {
bounded: bool,
},
Optional,
Partial(PartialNode),
}Expand description
One segment of an Idiom path.
Variants§
Start(Box<Spanned<Expr>>)
A leading value the rest of the path is applied to: $user.name,
(SELECT ...)[0]. Always the first part when present.
Field(String)
A plain field segment: name.
Index(Box<Spanned<Expr>>)
Index by expression: tags[0], tags[$i].
All
.* / [*].
Last
[$] — last element.
Graph
One graph step: ->likes / <-likes / <->likes, possibly a full
inline selection (->(likes WHERE since > $x)).
Fields
Destructure(Vec<Spanned<Idiom>>)
Brace selection: .{name, age} — real sub-idioms, not comma-split text.
Where(Box<Spanned<Expr>>)
Inline filter: [WHERE ...].
Method
Method call as a path part: foo.len().
Recurse
Graph recursion: .{1..3} / .{..} — bounded is whether an
upper bound was written.
Optional
Optional chaining marker: foo?.bar.
Partial(PartialNode)
A path segment that failed to lower.
Trait Implementations§
impl StructuralPartialEq for IdiomPart
Auto Trait Implementations§
impl Freeze for IdiomPart
impl RefUnwindSafe for IdiomPart
impl Send for IdiomPart
impl Sync for IdiomPart
impl Unpin for IdiomPart
impl UnsafeUnpin for IdiomPart
impl UnwindSafe for IdiomPart
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