pub struct Key(/* private fields */);
Expand description
A type identifying a spot in the hierarchy of Tree
items.
Implementations§
§impl Key
impl Key
pub fn add_child(self, child_id: u16) -> Key
pub fn add_child(self, child_id: u16) -> Key
Return the key to the child identified by child_id
located in a new nesting level below self
.
pub fn level(&self) -> u8
pub fn level(&self) -> u8
The level of hierarchy a node is placed in, i.e. the amount of path components
Return true if the item identified by other
shares the parent at parent_level
.
Trait Implementations§
§impl Ord for Key
impl Ord for Key
§impl PartialOrd<Key> for Key
impl PartialOrd<Key> for Key
§fn partial_cmp(&self, other: &Key) -> Option<Ordering>
fn partial_cmp(&self, other: &Key) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Key
impl Eq for Key
impl StructuralEq for Key
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnwindSafe for Key
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more