Skip to main content

NodeList

Struct NodeList 

Source
pub struct NodeList<BackendT, ContextT, ErrorT, IdT, DataT>(pub Vec<Node<BackendT, ContextT, ErrorT, IdT, DataT>>);
Expand description

Tree node list.

Tuple Fields§

§0: Vec<Node<BackendT, ContextT, ErrorT, IdT, DataT>>

Implementations§

Source§

impl<BackendT, ContextT, ErrorT, IdT, DataT> NodeList<BackendT, ContextT, ErrorT, IdT, DataT>

Source

pub fn iter( &self, only_expanded: bool, ) -> NodeIterator<'_, BackendT, ContextT, ErrorT, IdT, DataT>

Iterate nodes in visual order from top to bottom.

When only_expanded is true will skip the children of collapsed branches.

Source

pub fn at_path( &self, path: NodePath, ) -> Option<&Node<BackendT, ContextT, ErrorT, IdT, DataT>>
where BackendT: TreeBackend<ContextT, ErrorT, IdT, DataT>,

Get node at path.

Source

pub fn at_path_mut( &mut self, path: NodePath, ) -> Option<&mut Node<BackendT, ContextT, ErrorT, IdT, DataT>>
where BackendT: TreeBackend<ContextT, ErrorT, IdT, DataT>,

Get node at path.

Source

pub fn fill_path( &self, path: &mut NodePath, node: &Node<BackendT, ContextT, ErrorT, IdT, DataT>, ) -> bool
where BackendT: TreeBackend<ContextT, ErrorT, IdT, DataT>,

Fill path to node.

Returns true if found.

Source

pub fn add( &mut self, depth: usize, kind: NodeKind, id: IdT, representation: Representation, )
where BackendT: TreeBackend<ContextT, ErrorT, IdT, DataT>,

Add a node.

Source

pub fn insert( &mut self, index: usize, depth: usize, kind: NodeKind, id: IdT, representation: Representation, )
where BackendT: TreeBackend<ContextT, ErrorT, IdT, DataT>,

Insert a node.

Trait Implementations§

Source§

impl<BackendT, ContextT, ErrorT, IdT, DataT> Default for NodeList<BackendT, ContextT, ErrorT, IdT, DataT>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<BackendT, ContextT, ErrorT, IdT, DataT> From<Vec<Node<BackendT, ContextT, ErrorT, IdT, DataT>>> for NodeList<BackendT, ContextT, ErrorT, IdT, DataT>

Source§

fn from(vector: Vec<Node<BackendT, ContextT, ErrorT, IdT, DataT>>) -> Self

Converts to this type from the input type.
Source§

impl<BackendT, ContextT, ErrorT, IdT, DataT> FromIterator<Node<BackendT, ContextT, ErrorT, IdT, DataT>> for NodeList<BackendT, ContextT, ErrorT, IdT, DataT>

Source§

fn from_iter<IteratorT>(iterator: IteratorT) -> Self
where IteratorT: IntoIterator<Item = Node<BackendT, ContextT, ErrorT, IdT, DataT>>,

Creates a value from an iterator. Read more
Source§

impl<'this, BackendT, ContextT, ErrorT, IdT, DataT> IntoIterator for &'this NodeList<BackendT, ContextT, ErrorT, IdT, DataT>

Source§

type Item = &'this Node<BackendT, ContextT, ErrorT, IdT, DataT>

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'this, Node<BackendT, ContextT, ErrorT, IdT, DataT>>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'this, BackendT, ContextT, ErrorT, IdT, DataT> IntoIterator for &'this mut NodeList<BackendT, ContextT, ErrorT, IdT, DataT>

Source§

type Item = &'this mut Node<BackendT, ContextT, ErrorT, IdT, DataT>

The type of the elements being iterated over.
Source§

type IntoIter = IterMut<'this, Node<BackendT, ContextT, ErrorT, IdT, DataT>>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<BackendT, ContextT, ErrorT, IdT, DataT> Freeze for NodeList<BackendT, ContextT, ErrorT, IdT, DataT>

§

impl<BackendT, ContextT, ErrorT, IdT, DataT> RefUnwindSafe for NodeList<BackendT, ContextT, ErrorT, IdT, DataT>
where IdT: RefUnwindSafe, DataT: RefUnwindSafe, BackendT: RefUnwindSafe, ContextT: RefUnwindSafe, ErrorT: RefUnwindSafe,

§

impl<BackendT, ContextT, ErrorT, IdT, DataT> Send for NodeList<BackendT, ContextT, ErrorT, IdT, DataT>
where IdT: Send, DataT: Send, BackendT: Send, ContextT: Send, ErrorT: Send,

§

impl<BackendT, ContextT, ErrorT, IdT, DataT> Sync for NodeList<BackendT, ContextT, ErrorT, IdT, DataT>
where IdT: Sync, DataT: Sync, BackendT: Sync, ContextT: Sync, ErrorT: Sync,

§

impl<BackendT, ContextT, ErrorT, IdT, DataT> Unpin for NodeList<BackendT, ContextT, ErrorT, IdT, DataT>
where IdT: Unpin, DataT: Unpin, BackendT: Unpin, ContextT: Unpin, ErrorT: Unpin,

§

impl<BackendT, ContextT, ErrorT, IdT, DataT> UnsafeUnpin for NodeList<BackendT, ContextT, ErrorT, IdT, DataT>

§

impl<BackendT, ContextT, ErrorT, IdT, DataT> UnwindSafe for NodeList<BackendT, ContextT, ErrorT, IdT, DataT>
where IdT: UnwindSafe, DataT: UnwindSafe, BackendT: UnwindSafe, ContextT: UnwindSafe, ErrorT: UnwindSafe,

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, 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.
Source§

impl<T> With for T

Source§

fn wrap_with<U, F>(self, f: F) -> U
where F: FnOnce(Self) -> U,

Calls the given closure and return the result. Read more
Source§

fn with<F>(self, f: F) -> Self
where F: FnOnce(&mut Self),

Calls the given closure on self.
Source§

fn try_with<E, F>(self, f: F) -> Result<Self, E>
where F: FnOnce(&mut Self) -> Result<(), E>,

Calls the given closure on self.
Source§

fn with_if<F>(self, condition: bool, f: F) -> Self
where F: FnOnce(&mut Self),

Calls the given closure if condition == true.