pub struct ExprDict {
pub node_index: AtomicNodeIndex,
pub range: TextRange,
pub items: Vec<DictItem>,
}Expand description
See also Dict
Fields§
§node_index: AtomicNodeIndex§range: TextRange§items: Vec<DictItem>Implementations§
Source§impl ExprDict
impl ExprDict
Sourcepub fn iter_keys(&self) -> DictKeyIterator<'_> ⓘ
pub fn iter_keys(&self) -> DictKeyIterator<'_> ⓘ
Returns an Iterator over the AST nodes representing the
dictionary’s keys.
Sourcepub fn iter_values(&self) -> DictValueIterator<'_> ⓘ
pub fn iter_values(&self) -> DictValueIterator<'_> ⓘ
Returns an Iterator over the AST nodes representing the
dictionary’s values.
Sourcepub fn key(&self, n: usize) -> Option<&Expr>
pub fn key(&self, n: usize) -> Option<&Expr>
Returns the AST node representing the nth key of this dictionary.
Panics: If the index n is out of bounds.
Sourcepub fn value(&self, n: usize) -> &Expr
pub fn value(&self, n: usize) -> &Expr
Returns the AST node representing the nth value of this dictionary.
Panics: If the index n is out of bounds.
pub fn iter(&self) -> Iter<'_, DictItem>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl<'a> From<&'a ExprDict> for AnyNodeRef<'a>
impl<'a> From<&'a ExprDict> for AnyNodeRef<'a>
Source§fn from(node: &'a ExprDict) -> AnyNodeRef<'a>
fn from(node: &'a ExprDict) -> AnyNodeRef<'a>
Converts to this type from the input type.
Source§impl HasNodeIndex for ExprDict
impl HasNodeIndex for ExprDict
Source§fn node_index(&self) -> &AtomicNodeIndex
fn node_index(&self) -> &AtomicNodeIndex
Returns the
AtomicNodeIndex for this node.Source§impl<'a> IntoIterator for &'a ExprDict
impl<'a> IntoIterator for &'a ExprDict
Source§impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprDict
impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprDict
impl StructuralPartialEq for ExprDict
Auto Trait Implementations§
impl !Freeze for ExprDict
impl RefUnwindSafe for ExprDict
impl Send for ExprDict
impl Sync for ExprDict
impl Unpin for ExprDict
impl UnsafeUnpin for ExprDict
impl UnwindSafe for ExprDict
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more