Struct egui_dock::NodeIndex

source ·
pub struct NodeIndex(pub usize);
Expand description

Wrapper around indices to the collection of nodes inside a Tree.

Tuple Fields§

§0: usize

Implementations§

source§

impl NodeIndex

source

pub const fn root() -> Self

Returns the index of the root node.

source

pub const fn left(self) -> Self

Returns the index of the node to the left of the current one.

source

pub const fn right(self) -> Self

Returns the index of the node to the right of the current one.

source

pub const fn parent(self) -> Option<Self>

Returns the index of the parent node or None if current node is the root.

source

pub const fn level(self) -> usize

Returns the number of nodes leading from the root to the current node, including self.

source

pub const fn is_left(self) -> bool

Returns true if current node is the left node of its parent, false otherwise.

source

pub const fn is_right(self) -> bool

Returns true if current node is the right node of its parent, false otherwise.

Trait Implementations§

source§

impl Clone for NodeIndex

source§

fn clone(&self) -> NodeIndex

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NodeIndex

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<usize> for NodeIndex

source§

fn from(index: usize) -> Self

Converts to this type from the input type.
source§

impl Hash for NodeIndex

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<Tab> Index<NodeIndex> for Tree<Tab>

§

type Output = Node<Tab>

The returned type after indexing.
source§

fn index(&self, index: NodeIndex) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<Tab> IndexMut<NodeIndex> for Tree<Tab>

source§

fn index_mut(&mut self, index: NodeIndex) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
source§

impl PartialEq<NodeIndex> for NodeIndex

source§

fn eq(&self, other: &NodeIndex) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for NodeIndex

source§

impl Eq for NodeIndex

source§

impl StructuralEq for NodeIndex

source§

impl StructuralPartialEq for NodeIndex

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

impl<T> SerializableAny for Twhere T: 'static + Any + Clone + Send + Sync,