[][src]Struct azul_core::dom::NodeId

pub struct NodeId { /* fields omitted */ }

A node identifier within a particular Arena.

Implementations

impl NodeId[src]

pub const ZERO: NodeId[src]

pub fn new(value: usize) -> Self[src]

NOTE: In debug mode, it panics on overflow, since having a pointer that is zero is undefined behaviour (it would basically be cast to a None), which is incorrect, so we rather panic on overflow to prevent that.

To trigger an overflow however, you'd need more that 4 billion DOM nodes - it is more likely that you run out of RAM before you do that. The only thing that could lead to an overflow would be a bug. Therefore, overflow-checking is disabled in release mode.

pub fn index(&self) -> usize[src]

pub fn range(start: Self, end: Self) -> Vec<NodeId>[src]

Return an iterator of references to this node’s children.

impl NodeId[src]

pub const fn ancestors(self, node_hierarchy: &NodeHierarchy) -> Ancestors[src]

Return an iterator of references to this node and its ancestors.

Call .next().unwrap() once on the iterator to skip the node itself.

pub const fn preceding_siblings(
    self,
    node_hierarchy: &NodeHierarchy
) -> PrecedingSiblings
[src]

Return an iterator of references to this node and the siblings before it.

Call .next().unwrap() once on the iterator to skip the node itself.

pub const fn following_siblings(
    self,
    node_hierarchy: &NodeHierarchy
) -> FollowingSiblings
[src]

Return an iterator of references to this node and the siblings after it.

Call .next().unwrap() once on the iterator to skip the node itself.

pub fn children(self, node_hierarchy: &NodeHierarchy) -> Children[src]

Return an iterator of references to this node’s children.

pub fn reverse_children(self, node_hierarchy: &NodeHierarchy) -> ReverseChildren[src]

Return an iterator of references to this node’s children, in reverse order.

pub const fn descendants(self, node_hierarchy: &NodeHierarchy) -> Descendants[src]

Return an iterator of references to this node and its descendants, in tree order.

Parent nodes appear before the descendants. Call .next().unwrap() once on the iterator to skip the node itself.

pub const fn traverse(self, node_hierarchy: &NodeHierarchy) -> Traverse[src]

Return an iterator of references to this node and its descendants, in tree order.

pub const fn reverse_traverse(
    self,
    node_hierarchy: &NodeHierarchy
) -> ReverseTraverse
[src]

Return an iterator of references to this node and its descendants, in tree order.

Trait Implementations

impl Add<usize> for NodeId[src]

type Output = NodeId

The resulting type after applying the + operator.

impl AddAssign<usize> for NodeId[src]

impl Clone for NodeId[src]

impl Copy for NodeId[src]

impl Debug for NodeId[src]

impl Display for NodeId[src]

impl Eq for NodeId[src]

impl Hash for NodeId[src]

impl Index<NodeId> for NodeHierarchy[src]

type Output = Node

The returned type after indexing.

impl<T> Index<NodeId> for NodeDataContainer<T>[src]

type Output = T

The returned type after indexing.

impl IndexMut<NodeId> for NodeHierarchy[src]

impl<T> IndexMut<NodeId> for NodeDataContainer<T>[src]

impl Ord for NodeId[src]

impl PartialEq<NodeId> for NodeId[src]

impl PartialOrd<NodeId> for NodeId[src]

impl StructuralEq for NodeId[src]

impl StructuralPartialEq for NodeId[src]

Auto Trait Implementations

impl RefUnwindSafe for NodeId

impl Send for NodeId

impl Sync for NodeId

impl Unpin for NodeId

impl UnwindSafe for NodeId

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.