pub struct InkTree<'a> { /* private fields */ }
Expand description
A wrapper for ink! entity tree navigation methods that return opaque iterator types.
Implementations§
Source§impl<'a> InkTree<'a>
impl<'a> InkTree<'a>
Sourcepub fn new(node: &'a SyntaxNode) -> Self
pub fn new(node: &'a SyntaxNode) -> Self
Creates an ink! entity tree instance for the syntax node.
Sourcepub fn ink_attrs(&self) -> impl Iterator<Item = InkAttribute>
pub fn ink_attrs(&self) -> impl Iterator<Item = InkAttribute>
Returns ink! attributes for the ink! entity.
Sourcepub fn ink_attrs_descendants(&self) -> impl Iterator<Item = InkAttribute>
pub fn ink_attrs_descendants(&self) -> impl Iterator<Item = InkAttribute>
Returns ink! attributes for all the ink! entity’s descendants.
Sourcepub fn ink_attrs_closest_descendants(
&self,
) -> impl Iterator<Item = InkAttribute>
pub fn ink_attrs_closest_descendants( &self, ) -> impl Iterator<Item = InkAttribute>
Returns ink! attributes for all the ink! entity’s descendants that don’t have any ink! ancestors between them and the entity.
Sourcepub fn ink_attrs_in_scope(&self) -> impl Iterator<Item = InkAttribute>
pub fn ink_attrs_in_scope(&self) -> impl Iterator<Item = InkAttribute>
Returns ink! attributes in the ink! entity’s scope. This includes both the ink! entity’s own ink! attributes and those of all of it’s descendants.
Sourcepub fn ink_attrs_ancestors(&self) -> impl Iterator<Item = InkAttribute> + '_
pub fn ink_attrs_ancestors(&self) -> impl Iterator<Item = InkAttribute> + '_
Returns ink! attributes for all the ink! entity’s ancestors.
Sourcepub fn ink_attrs_closest_ancestors(&self) -> impl Iterator<Item = InkAttribute>
pub fn ink_attrs_closest_ancestors(&self) -> impl Iterator<Item = InkAttribute>
Returns ink! attributes for all the ink! entity’s ancestors that don’t have any ink! ancestors between them and the item.
Sourcepub fn ink_args(&self) -> impl Iterator<Item = InkArg>
pub fn ink_args(&self) -> impl Iterator<Item = InkArg>
Returns ink! arguments of the ink! entity.
Sourcepub fn ink_args_by_kind(&self, kind: InkArgKind) -> impl Iterator<Item = InkArg>
pub fn ink_args_by_kind(&self, kind: InkArgKind) -> impl Iterator<Item = InkArg>
Returns ink! arguments of a specific kind (if any) for the ink! entity.
Sourcepub fn ink_arg_by_kind(&self, kind: InkArgKind) -> Option<InkArg>
pub fn ink_arg_by_kind(&self, kind: InkArgKind) -> Option<InkArg>
Returns ink! argument of a specific kind (if any) for the ink! entity.