Struct InkTree

Source
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>

Source

pub fn new(node: &'a SyntaxNode) -> Self

Creates an ink! entity tree instance for the syntax node.

Source

pub fn ink_attrs(&self) -> impl Iterator<Item = InkAttribute>

Returns ink! attributes for the ink! entity.

Source

pub fn ink_attrs_descendants(&self) -> impl Iterator<Item = InkAttribute>

Returns ink! attributes for all the ink! entity’s descendants.

Source

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.

Source

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.

Source

pub fn ink_attrs_ancestors(&self) -> impl Iterator<Item = InkAttribute> + '_

Returns ink! attributes for all the ink! entity’s ancestors.

Source

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.

Source

pub fn ink_args(&self) -> impl Iterator<Item = InkArg>

Returns ink! arguments of the ink! entity.

Source

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.

Source

pub fn ink_arg_by_kind(&self, kind: InkArgKind) -> Option<InkArg>

Returns ink! argument of a specific kind (if any) for the ink! entity.

Auto Trait Implementations§

§

impl<'a> Freeze for InkTree<'a>

§

impl<'a> !RefUnwindSafe for InkTree<'a>

§

impl<'a> !Send for InkTree<'a>

§

impl<'a> !Sync for InkTree<'a>

§

impl<'a> Unpin for InkTree<'a>

§

impl<'a> !UnwindSafe for InkTree<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoBox<dyn Any> for T
where T: Any,

Source§

fn into_box(self) -> Box<dyn Any>

Convert self into the appropriate boxed form.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.