pub struct MapProjectionItem { /* private fields */ }Expand description
Typed wrapper for one item inside a MapProjection.
Spec §6.1 / §19 row “Map projection” (cy-01q). Each item is one of
the four MapProjectionItemKind shapes; classify with Self::kind
and use the kind-specific accessors.
Implementations§
Source§impl MapProjectionItem
impl MapProjectionItem
Sourcepub fn cast(syntax: SyntaxNode) -> Option<Self>
pub fn cast(syntax: SyntaxNode) -> Option<Self>
Try to cast a raw SyntaxNode to a MapProjectionItem. Returns
None unless syntax.kind() == MAP_PROJECTION_ITEM.
Sourcepub fn syntax(&self) -> &SyntaxNode
pub fn syntax(&self) -> &SyntaxNode
The underlying SyntaxNode.
Sourcepub fn kind(&self) -> MapProjectionItemKind
pub fn kind(&self) -> MapProjectionItemKind
Classify this item by inspecting its leading non-trivia tokens.
The four shapes are unambiguous once we know whether the first
significant token is ., *, or an identifier — see the parser’s
map_projection_item for the inverse.
Sourcepub fn key_token(&self) -> Option<SyntaxToken>
pub fn key_token(&self) -> Option<SyntaxToken>
For PropertySelector and Literal items, return the bound
property-key token. Returns None for spread forms or malformed
recovery shapes.
Trait Implementations§
Source§impl Clone for MapProjectionItem
impl Clone for MapProjectionItem
Source§fn clone(&self) -> MapProjectionItem
fn clone(&self) -> MapProjectionItem
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MapProjectionItem
impl Debug for MapProjectionItem
Source§impl Hash for MapProjectionItem
impl Hash for MapProjectionItem
Source§impl PartialEq for MapProjectionItem
impl PartialEq for MapProjectionItem
Source§fn eq(&self, other: &MapProjectionItem) -> bool
fn eq(&self, other: &MapProjectionItem) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for MapProjectionItem
impl StructuralPartialEq for MapProjectionItem
Auto Trait Implementations§
impl Freeze for MapProjectionItem
impl !RefUnwindSafe for MapProjectionItem
impl !Send for MapProjectionItem
impl !Sync for MapProjectionItem
impl Unpin for MapProjectionItem
impl UnsafeUnpin for MapProjectionItem
impl !UnwindSafe for MapProjectionItem
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